| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| <title>MADlib: crf_data_loader.sql_in File Reference</title> |
| |
| <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="jquery.js"></script> |
| <script type="text/javascript" src="resize.js"></script> |
| <script type="text/javascript" src="navtree.js"></script> |
| <script type="text/javascript"> |
| $(document).ready(initResizable); |
| </script> |
| <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="search/search.js"></script> |
| <script type="text/javascript"> |
| $(document).ready(function() { searchBox.OnSelectItem(0); }); |
| </script> |
| <script src="../mathjax/MathJax.js"> |
| MathJax.Hub.Config({ |
| extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"], |
| jax: ["input/TeX","output/HTML-CSS"], |
| }); |
| </script> |
| </head> |
| <body> |
| <div id="top"><!-- do not remove this div! --> |
| |
| |
| <div id="titlearea"> |
| <table cellspacing="0" cellpadding="0"> |
| <tbody> |
| <tr style="height: 56px;"> |
| |
| |
| <td style="padding-left: 0.5em;"> |
| <div id="projectname">MADlib |
|  <span id="projectnumber">0.6</span> <span style="font-size:10pt; font-style:italic"><a href="../latest/./crf__data__loader_8sql__in.html"> A newer version is available</a></span> |
| </div> |
| <div id="projectbrief">User Documentation</div> |
| </td> |
| |
| |
| |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| |
| <!-- Generated by Doxygen 1.7.5.1 --> |
| <script type="text/javascript"> |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| </script> |
| <script type="text/javascript" src="dynsections.js"></script> |
| <div id="navrow1" class="tabs"> |
| <ul class="tablist"> |
| <li><a href="index.html"><span>Main Page</span></a></li> |
| <li><a href="modules.html"><span>Modules</span></a></li> |
| <li class="current"><a href="files.html"><span>Files</span></a></li> |
| <li> |
| <div id="MSearchBox" class="MSearchBoxInactive"> |
| <span class="left"> |
| <img id="MSearchSelect" src="search/mag_sel.png" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| alt=""/> |
| <input type="text" id="MSearchField" value="Search" accesskey="S" |
| onfocus="searchBox.OnSearchFieldFocus(true)" |
| onblur="searchBox.OnSearchFieldFocus(false)" |
| onkeyup="searchBox.OnSearchFieldChange(event)"/> |
| </span><span class="right"> |
| <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> |
| </span> |
| </div> |
| </li> |
| </ul> |
| </div> |
| <div id="navrow2" class="tabs2"> |
| <ul class="tablist"> |
| <li><a href="files.html"><span>File List</span></a></li> |
| <li><a href="globals.html"><span>File Members</span></a></li> |
| </ul> |
| </div> |
| </div> |
| <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| <div id="nav-tree"> |
| <div id="nav-tree-contents"> |
| </div> |
| </div> |
| <div id="splitbar" style="-moz-user-select:none;" |
| class="ui-resizable-handle"> |
| </div> |
| </div> |
| <script type="text/javascript"> |
| initNavTree('crf__data__loader_8sql__in.html',''); |
| </script> |
| <div id="doc-content"> |
| <div class="header"> |
| <div class="summary"> |
| <a href="#func-members">Functions</a> </div> |
| <div class="headertitle"> |
| <div class="title">crf_data_loader.sql_in File Reference</div> </div> |
| </div> |
| <div class="contents"> |
| |
| <p>Create database tables and import POS/NER training/testing data to the database. |
| <a href="#details">More...</a></p> |
| |
| <p><a href="crf__data__loader_8sql__in_source.html">Go to the source code of this file.</a></p> |
| <table class="memberdecls"> |
| <tr><td colspan="2"><h2><a name="func-members"></a> |
| Functions</h2></td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="crf__data__loader_8sql__in.html#aaa609ec1d1d4cff0f335fa358091d5c3">crf_train_data</a> (text datapath)</td></tr> |
| <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="crf__data__loader_8sql__in.html#abf2a39a0b84a5e7ae215db28b3a87f81">crf_test_data</a> (text datapath)</td></tr> |
| </table> |
| <hr/><a name="details" id="details"></a><h2>Detailed Description</h2> |
| <div class="textblock"><dl class="date"><dt><b>Date:</b></dt><dd>Feb. 2012 </dd></dl> |
| |
| <p>Definition in file <a class="el" href="crf__data__loader_8sql__in_source.html">crf_data_loader.sql_in</a>.</p> |
| </div><hr/><h2>Function Documentation</h2> |
| <a class="anchor" id="abf2a39a0b84a5e7ae215db28b3a87f81"></a><!-- doxytag: member="crf_data_loader.sql_in::crf_test_data" ref="abf2a39a0b84a5e7ae215db28b3a87f81" args="(text datapath)" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">void crf_test_data </td> |
| <td>(</td> |
| <td class="paramtype">text </td> |
| <td class="paramname"><em>datapath</em></td><td>)</td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| <dl class="user"><dt><b>Input:</b></dt><dd></dd></dl> |
| <ol type="1"> |
| <li>Prepare an input test data segment table, e.g.:</li> |
| </ol> |
| <ul> |
| <li>CREATE TABLE test_segmenttbl (start_pos integer,doc_id integer,seg_text text, max_pos integer) <div class="fragment"><pre class="fragment"> |
| sql> select * from test_segmenttbl order by doc_id, start_pos; |
| start_pos | doc_id | seg_text | max_pos |
| ----------+---------+--------------+------------- |
| 0 | 1 | the | 26 |
| 1 | 1 | madlib | 26 |
| 2 | 1 | mission | 26 |
| 3 | 1 | : | 26 |
| 4 | 1 | to | 26 |
| 5 | 1 | foster | 26 |
| 6 | 1 | widespread | 26 |
| 7 | 1 | development | 26 |
| 8 | 1 | of | 26 |
| 9 | 1 | scalable | 26 |
| 10 | 1 | analytic | 26 |
| 11 | 1 | skills | 26 |
| 12 | 1 | , | 26 |
| 13 | 1 | by | 26 |
| ... |
| 24 | 1 | open-source | 26 |
| 25 | 1 | development | 26 |
| 26 | 1 | . | 26 |
| </pre></div></li> |
| </ul> |
| <dl class="user"><dt><b>Usage:</b></dt><dd><ul> |
| <li>create tables and import data to the database SELECT madlib.crf_test_data('/path/to/modeldata') </li> |
| </ul> |
| </dd></dl> |
| |
| <p>Definition at line <a class="el" href="crf__data__loader_8sql__in_source.html#l00231">231</a> of file <a class="el" href="crf__data__loader_8sql__in_source.html">crf_data_loader.sql_in</a>.</p> |
| |
| </div> |
| </div> |
| <a class="anchor" id="aaa609ec1d1d4cff0f335fa358091d5c3"></a><!-- doxytag: member="crf_data_loader.sql_in::crf_train_data" ref="aaa609ec1d1d4cff0f335fa358091d5c3" args="(text datapath)" --> |
| <div class="memitem"> |
| <div class="memproto"> |
| <table class="memname"> |
| <tr> |
| <td class="memname">void crf_train_data </td> |
| <td>(</td> |
| <td class="paramtype">text </td> |
| <td class="paramname"><em>datapath</em></td><td>)</td> |
| <td></td> |
| </tr> |
| </table> |
| </div> |
| <div class="memdoc"> |
| <dl class="user"><dt><b>Input:</b></dt><dd></dd></dl> |
| <ol type="1"> |
| <li>Prepare an input train data segment table, e.g.:</li> |
| </ol> |
| <ul> |
| <li>CREATE TABLE train_segmenttbl (start_pos integer,doc_id integer,seg_text text, max_pos integer) <div class="fragment"><pre class="fragment"> |
| sql> select * from train_segmenttbl order by doc_id, start_pos; |
| start_pos | doc_id | seg_text | max_pos |
| ----------+---------+--------------+------------- |
| 0 | 1 | madlib | 9 |
| 1 | 1 | is | 9 |
| 2 | 1 | an | 9 |
| 3 | 1 | open-source | 9 |
| 4 | 1 | library | 9 |
| 5 | 1 | for | 9 |
| 6 | 1 | scalable | 9 |
| 7 | 1 | in-database | 9 |
| 8 | 1 | analytics | 9 |
| 9 | 1 | . | 9 |
| 0 | 2 | it | 16 |
| 1 | 2 | provides | 16 |
| 2 | 2 |data-parallel | 16 |
| 3 | 2 |implementations| 16 |
| ... |
| 14 | 2 | unstructured | 16 |
| 15 | 2 | data | 16 |
| 16 | 2 | . | 16 |
| </pre></div></li> |
| </ul> |
| <ol type="1"> |
| <li>Prepare an input dictionary table, e.g.,:</li> |
| </ol> |
| <ul> |
| <li>CREATE TABLE crf_dictionary (token text,token_id integer,label text,count integer,total integer) <div class="fragment"><pre class="fragment"> |
| sql> select * from crf_dictionary; |
| token | label | count | total |
| ------------+--------+-------------- |
| freefall | 11 | 1 | 1 |
| policy | 11 | 2 | 2 |
| measures | 12 | 1 | 1 |
| commitment | 11 | 1 | 1 |
| new | 6 | 1 | 1 |
| speech | 11 | 1 | 1 |
| 's | 16 | 2 | 2 |
| reckon | 30 | 1 | 1 |
| underlying | 28 | 1 | 1 |
| ... |
| </pre></div></li> |
| </ul> |
| <ol type="1"> |
| <li>Prepare an input label table, e.g.,:</li> |
| </ol> |
| <ul> |
| <li>CREATE TABLE labeltbl (id integer,label character varying) <div class="fragment"><pre class="fragment"> |
| sql> select * from labeltbl order by id; |
| id | label |
| ------------+-------- |
| 0 | CC |
| 1 | CD |
| 2 | DT |
| 3 | EX |
| 4 | FW |
| 5 | IN |
| 6 | JJ |
| ... |
| 42 | , |
| 43 | . |
| 44 | : |
| </pre></div></li> |
| </ul> |
| <ol type="1"> |
| <li>Prepare an input regex table, e.g.,:</li> |
| </ol> |
| <ul> |
| <li>CREATE TABLE crf_regex (pattern text,name text) <div class="fragment"><pre class="fragment"> |
| sql> select * from crf_regex; |
| pattern | name |
| ------------- +--------------- |
| ^[A-Z][a-z]+$ | InitCapital% |
| ^[A-Z]+$ | isAllCapital% |
| ^.*[0-9]+.*$ | containsDigit% |
| ^.+[.]$ | endsWithDot% |
| ^.+[,]$ | endsWithComma% |
| ^.+er$ | endsWithER% |
| ^.+est$ | endsWithEst% |
| ^.+ed$ | endsWithED% |
| ... |
| </pre></div></li> |
| </ul> |
| <ol type="1"> |
| <li>Prepare an input feature table, e.g.,:</li> |
| </ol> |
| <ul> |
| <li>CREATE TABLE featuretbl (id integer,name text,prev_label_id integer,label_id integer,weight float) <div class="fragment"><pre class="fragment"> |
| sql> select * from featuretbl order by id; |
| id | name | prev_label_id | label_id | weight |
| ------------------------------------------------------- |
| 1 | W_chancellor | -1 | 13 | 2.2322 |
| 2 | E.13 | 13 | 5 | 2.3995 |
| 3 | U | -1 | 5 | 1.2164 |
| 4 | W_of | -1 | 5 | 2.8744 |
| 5 | E.5 | 5 | 2 | 3.7716 |
| 6 | W_the | -1 | 2 | 4.1790 |
| 7 | E.2 | 2 | 13 | 0.8957 |
| ... |
| </pre></div></li> |
| </ul> |
| <ol type="1"> |
| <li>Prepare an crf feature set table, e.g.,:</li> |
| </ol> |
| <ul> |
| <li>CREATE TABLE MADlib.crf_feature_dic(f_index integer, f_name text, feature integer[]) <div class="fragment"><pre class="fragment"> |
| sql> select * from crf_feature_dic order by id; |
| f_index| f_name | feature |
| -------------------------------- |
| 0 | W_chancellor | -1 |
| 1 | E.13 | 13 |
| 2 | U | -1 |
| 3 | W_of | -1 |
| 4 | E.5 | 5 |
| 5 | W_the | -1 |
| ... |
| </pre></div></li> |
| </ul> |
| <dl class="user"><dt><b>Usage:</b></dt><dd><ul> |
| <li>create tables and import data to the database SELECT madlib.crf_train_data('/path/to/modeldata') </li> |
| </ul> |
| </dd></dl> |
| |
| <p>Definition at line <a class="el" href="crf__data__loader_8sql__in_source.html#l00155">155</a> of file <a class="el" href="crf__data__loader_8sql__in_source.html">crf_data_loader.sql_in</a>.</p> |
| |
| </div> |
| </div> |
| </div> |
| </div> |
| <div id="nav-path" class="navpath"> |
| <ul> |
| <li class="navelem"><a class="el" href="crf__data__loader_8sql__in.html">crf_data_loader.sql_in</a> </li> |
| <!-- window showing the filter options --> |
| <div id="MSearchSelectWindow" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark"> </span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark"> </span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark"> </span>Functions</a></div> |
| |
| <!-- iframe showing the search results (closed by default) --> |
| <div id="MSearchResultsWindow"> |
| <iframe src="javascript:void(0)" frameborder="0" |
| name="MSearchResults" id="MSearchResults"> |
| </iframe> |
| </div> |
| |
| |
| <li class="footer">Generated on Tue Apr 2 2013 14:57:03 for MADlib by |
| <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li> |
| </ul> |
| </div> |
| |
| |
| </body> |
| </html> |