blob: 16ab4d91c18a4f9c70dfae9a3842a43fe60c9fac [file] [log] [blame]
<!-- HTML header for doxygen 1.8.4-->
<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="keywords" content="madlib,postgres,greenplum,machine learning,data mining,deep learning,ensemble methods,data science,market basket analysis,affinity analysis,pca,lda,regression,elastic net,huber white,proportional hazards,k-means,latent dirichlet allocation,bayes,support vector machines,svm"/>
<title>MADlib: crf_data_loader.sql_in File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.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/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
$(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Config({
extensions: ["tex2jax.js", "TeX/AMSmath.js", "TeX/AMSsymbols.js"],
jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<!-- hack in the navigation tree -->
<script type="text/javascript" src="eigen_navtree_hacks.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="madlib_extra.css" rel="stylesheet" type="text/css"/>
<!-- google analytics -->
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-45382226-1', 'madlib.apache.org');
ga('send', 'pageview');
</script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><a href="http://madlib.apache.org"><img alt="Logo" src="madlib.png" height="50" style="padding-left:0.5em;" border="0"/ ></a></td>
<td style="padding-left: 0.5em;">
<div id="projectname">
<span id="projectnumber">1.16</span>
</div>
<div id="projectbrief">User Documentation for Apache MADlib</div>
</td>
<td> <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>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('crf__data__loader_8sql__in.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</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>
<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><!--header-->
<div class="contents">
<p>Create database tables and import POS/NER training/testing data to the database.
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:aaa609ec1d1d4cff0f335fa358091d5c3"><td class="memItemLeft" align="right" valign="top">void&#160;</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 class="separator:aaa609ec1d1d4cff0f335fa358091d5c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abf2a39a0b84a5e7ae215db28b3a87f81"><td class="memItemLeft" align="right" valign="top">void&#160;</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>
<tr class="separator:abf2a39a0b84a5e7ae215db28b3a87f81"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><dl class="section date"><dt>Date</dt><dd>Feb. 2012 </dd></dl>
</div><h2 class="groupheader">Function Documentation</h2>
<a id="abf2a39a0b84a5e7ae215db28b3a87f81"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abf2a39a0b84a5e7ae215db28b3a87f81">&#9670;&nbsp;</a></span>crf_test_data()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void crf_test_data </td>
<td>(</td>
<td class="paramtype">text&#160;</td>
<td class="paramname"><em>datapath</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Input</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) <pre class="fragment">sql&gt; 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></li>
</ul>
<dl class="section user"><dt>Usage</dt><dd><ul>
<li>create tables and import data to the database SELECT madlib.crf_test_data('/path/to/modeldata') </li>
</ul>
</dd></dl>
</div>
</div>
<a id="aaa609ec1d1d4cff0f335fa358091d5c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa609ec1d1d4cff0f335fa358091d5c3">&#9670;&nbsp;</a></span>crf_train_data()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void crf_train_data </td>
<td>(</td>
<td class="paramtype">text&#160;</td>
<td class="paramname"><em>datapath</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Input</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) <pre class="fragment">sql&gt; 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></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) <pre class="fragment">sql&gt; 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></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) <pre class="fragment">sql&gt; 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></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) <pre class="fragment">sql&gt; 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></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) <pre class="fragment">sql&gt; 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></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[]) <pre class="fragment">sql&gt; 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></li>
</ul>
<dl class="section user"><dt>Usage</dt><dd><ul>
<li>create tables and import data to the database SELECT madlib.crf_train_data('/path/to/modeldata') </li>
</ul>
</dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_efbcf68973d247bbf15f9eecae7f24e3.html">ports</a></li><li class="navelem"><a class="el" href="dir_a4a48839224ef8488facbffa8a397967.html">postgres</a></li><li class="navelem"><a class="el" href="dir_dc596537ad427a4d866006d1a3e1fe29.html">modules</a></li><li class="navelem"><a class="el" href="dir_70e9abe17564e15776adcab8550c7667.html">crf</a></li><li class="navelem"><a class="el" href="crf__data__loader_8sql__in.html">crf_data_loader.sql_in</a></li>
<li class="footer">Generated on Tue Jul 2 2019 22:35:49 for MADlib by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
</ul>
</div>
</body>
</html>