| <!DOCTYPE HTML> |
| <html lang> |
| <head> |
| <!-- Generated by javadoc (17) --> |
| <title>GISTrainer (Apache OpenNLP Tools 2.5.6 API)</title> |
| <meta name="viewport" content="width=device-width, initial-scale=1"> |
| <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> |
| <meta name="description" content="declaration: package: opennlp.tools.ml.maxent, class: GISTrainer"> |
| <meta name="generator" content="javadoc/ClassWriterImpl"> |
| <link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../script-dir/jquery-ui.min.css" title="Style"> |
| <link rel="stylesheet" type="text/css" href="../../../../jquery-ui.overrides.css" title="Style"> |
| <script type="text/javascript" src="../../../../script.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-3.7.1.min.js"></script> |
| <script type="text/javascript" src="../../../../script-dir/jquery-ui.min.js"></script> |
| </head> |
| <body class="class-declaration-page"> |
| <script type="text/javascript">var evenRowColor = "even-row-color"; |
| var oddRowColor = "odd-row-color"; |
| var tableTab = "table-tab"; |
| var activeTableTab = "active-table-tab"; |
| var pathtoroot = "../../../../"; |
| loadScripts(document, 'script');</script> |
| <noscript> |
| <div>JavaScript is disabled on your browser.</div> |
| </noscript> |
| <div class="flex-box"> |
| <header role="banner" class="flex-header"> |
| <nav role="navigation"> |
| <!-- ========= START OF TOP NAVBAR ======= --> |
| <div class="top-nav" id="navbar-top"> |
| <div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div> |
| <ul id="navbar-top-firstrow" class="nav-list" title="Navigation"> |
| <li><a href="../../../../index.html">Overview</a></li> |
| <li><a href="package-summary.html">Package</a></li> |
| <li class="nav-bar-cell1-rev">Class</li> |
| <li><a href="package-tree.html">Tree</a></li> |
| <li><a href="../../../../deprecated-list.html">Deprecated</a></li> |
| <li><a href="../../../../index-all.html">Index</a></li> |
| <li><a href="../../../../help-doc.html#class">Help</a></li> |
| </ul> |
| </div> |
| <div class="sub-nav"> |
| <div> |
| <ul class="sub-nav-list"> |
| <li>Summary: </li> |
| <li>Nested | </li> |
| <li><a href="#field-summary">Field</a> | </li> |
| <li><a href="#constructor-summary">Constr</a> | </li> |
| <li><a href="#method-summary">Method</a></li> |
| </ul> |
| <ul class="sub-nav-list"> |
| <li>Detail: </li> |
| <li><a href="#field-detail">Field</a> | </li> |
| <li><a href="#constructor-detail">Constr</a> | </li> |
| <li><a href="#method-detail">Method</a></li> |
| </ul> |
| </div> |
| <div class="nav-list-search"><label for="search-input">SEARCH:</label> |
| <input type="text" id="search-input" value="search" disabled="disabled"> |
| <input type="reset" id="reset-button" value="reset" disabled="disabled"> |
| </div> |
| </div> |
| <!-- ========= END OF TOP NAVBAR ========= --> |
| <span class="skip-nav" id="skip-navbar-top"></span></nav> |
| </header> |
| <div class="flex-content"> |
| <main role="main"> |
| <!-- ======== START OF CLASS DATA ======== --> |
| <div class="header"> |
| <div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">opennlp.tools.ml.maxent</a></div> |
| <h1 title="Class GISTrainer" class="title">Class GISTrainer</h1> |
| </div> |
| <div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a> |
| <div class="inheritance"><a href="../AbstractTrainer.html" title="class in opennlp.tools.ml">opennlp.tools.ml.AbstractTrainer</a> |
| <div class="inheritance"><a href="../AbstractEventTrainer.html" title="class in opennlp.tools.ml">opennlp.tools.ml.AbstractEventTrainer</a> |
| <div class="inheritance">opennlp.tools.ml.maxent.GISTrainer</div> |
| </div> |
| </div> |
| </div> |
| <section class="class-description" id="class-description"> |
| <dl class="notes"> |
| <dt>All Implemented Interfaces:</dt> |
| <dd><code><a href="../../commons/Trainer.html" title="interface in opennlp.tools.commons">Trainer</a></code>, <code><a href="../EventTrainer.html" title="interface in opennlp.tools.ml">EventTrainer</a></code></dd> |
| </dl> |
| <hr> |
| <div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">GISTrainer</span> |
| <span class="extends-implements">extends <a href="../AbstractEventTrainer.html" title="class in opennlp.tools.ml">AbstractEventTrainer</a></span></div> |
| <div class="block">An implementation of Generalized Iterative Scaling (GIS). |
| <p> |
| The reference paper for this implementation was Adwait Ratnaparkhi's tech report at the |
| University of Pennsylvania's Institute for Research in Cognitive Science, |
| and is available at <a href="ftp://ftp.cis.upenn.edu/pub/ircs/tr/97-08.ps.Z"> |
| ftp://ftp.cis.upenn.edu/pub/ircs/tr/97-08.ps.Z</a>. |
| <p> |
| The slack parameter used in the above implementation has been removed by default |
| from the computation and a method for updating with Gaussian smoothing has been |
| added per Investigating GIS and Smoothing for Maximum Entropy Taggers, Clark and Curran (2002). |
| <a href="http://acl.ldc.upenn.edu/E/E03/E03-1071.pdf">http://acl.ldc.upenn.edu/E/E03/E03-1071.pdf</a>. |
| <p> |
| The slack parameter can be used by setting <code>useSlackParameter</code> to <code>true</code>. |
| Gaussian smoothing can be used by setting <code>useGaussianSmoothing</code> to <code>true</code>. |
| <p> |
| A <a href="../model/Prior.html" title="interface in opennlp.tools.ml.model"><code>Prior</code></a> can be used to train models which converge to the distribution which minimizes the |
| relative entropy between the distribution specified by the empirical constraints of the training |
| data and the specified prior. By default, the uniform distribution is used as the prior.</div> |
| </section> |
| <section class="summary"> |
| <ul class="summary-list"> |
| <!-- =========== FIELD SUMMARY =========== --> |
| <li> |
| <section class="field-summary" id="field-summary"> |
| <h2>Field Summary</h2> |
| <div class="caption"><span>Fields</span></div> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Field</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color"><code>static final double</code></div> |
| <div class="col-second even-row-color"><code><a href="#LOG_LIKELIHOOD_THRESHOLD_DEFAULT" class="member-name-link">LOG_LIKELIHOOD_THRESHOLD_DEFAULT</a></code></div> |
| <div class="col-last even-row-color"> </div> |
| <div class="col-first odd-row-color"><code>static final <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second odd-row-color"><code><a href="#LOG_LIKELIHOOD_THRESHOLD_PARAM" class="member-name-link">LOG_LIKELIHOOD_THRESHOLD_PARAM</a></code></div> |
| <div class="col-last odd-row-color"> </div> |
| <div class="col-first even-row-color"><code>static final <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div> |
| <div class="col-second even-row-color"><code><a href="#MAXENT_VALUE" class="member-name-link">MAXENT_VALUE</a></code></div> |
| <div class="col-last even-row-color"> </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="fields-inherited-from-class-opennlp.tools.ml.AbstractEventTrainer">Fields inherited from class opennlp.tools.ml.<a href="../AbstractEventTrainer.html" title="class in opennlp.tools.ml">AbstractEventTrainer</a></h3> |
| <code><a href="../AbstractEventTrainer.html#DATA_INDEXER_ONE_PASS_REAL_VALUE">DATA_INDEXER_ONE_PASS_REAL_VALUE</a>, <a href="../AbstractEventTrainer.html#DATA_INDEXER_ONE_PASS_VALUE">DATA_INDEXER_ONE_PASS_VALUE</a>, <a href="../AbstractEventTrainer.html#DATA_INDEXER_PARAM">DATA_INDEXER_PARAM</a>, <a href="../AbstractEventTrainer.html#DATA_INDEXER_TWO_PASS_VALUE">DATA_INDEXER_TWO_PASS_VALUE</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="fields-inherited-from-class-opennlp.tools.ml.EventTrainer">Fields inherited from interface opennlp.tools.ml.<a href="../EventTrainer.html" title="interface in opennlp.tools.ml">EventTrainer</a></h3> |
| <code><a href="../EventTrainer.html#EVENT_VALUE">EVENT_VALUE</a></code></div> |
| </section> |
| </li> |
| <!-- ======== CONSTRUCTOR SUMMARY ======== --> |
| <li> |
| <section class="constructor-summary" id="constructor-summary"> |
| <h2>Constructor Summary</h2> |
| <div class="caption"><span>Constructors</span></div> |
| <div class="summary-table two-column-summary"> |
| <div class="table-header col-first">Constructor</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">GISTrainer</a>()</code></div> |
| <div class="col-last even-row-color"> |
| <div class="block">Initializes a <a href="GISTrainer.html" title="class in opennlp.tools.ml.maxent"><code>GISTrainer</code></a>.</div> |
| </div> |
| </div> |
| </section> |
| </li> |
| <!-- ========== METHOD SUMMARY =========== --> |
| <li> |
| <section class="method-summary" id="method-summary"> |
| <h2>Method Summary</h2> |
| <div id="method-summary-table"> |
| <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div> |
| <div id="method-summary-table.tabpanel" role="tabpanel" aria-labelledby="method-summary-table-tab0"> |
| <div class="summary-table three-column-summary"> |
| <div class="table-header col-first">Modifier and Type</div> |
| <div class="table-header col-second">Method</div> |
| <div class="table-header col-last">Description</div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../model/MaxentModel.html" title="interface in opennlp.tools.ml.model">MaxentModel</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#doTrain(opennlp.tools.ml.model.DataIndexer)" class="member-name-link">doTrain</a><wbr>(<a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model">DataIndexer</a> indexer)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"></div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#init(opennlp.tools.util.TrainingParameters,java.util.Map)" class="member-name-link">init</a><wbr>(<a href="../../util/TrainingParameters.html" title="class in opennlp.tools.util">TrainingParameters</a> trainingParameters, |
| <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>> reportMap)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Initializes a <a href="../AbstractTrainer.html" title="class in opennlp.tools.ml"><code>AbstractTrainer</code></a> via <a href="../../util/TrainingParameters.html" title="class in opennlp.tools.util"><code>TrainingParameters</code></a> and |
| a <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link"><code>report map</code></a>.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>boolean</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#isSortAndMerge()" class="member-name-link">isSortAndMerge</a>()</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"></div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setGaussianSigma(double)" class="member-name-link">setGaussianSigma</a><wbr>(double sigmaValue)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets whether this trainer will use smoothing while training the model.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setSmoothing(boolean)" class="member-name-link">setSmoothing</a><wbr>(boolean smooth)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets whether this trainer will use smoothing while training the model.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setSmoothingObservation(double)" class="member-name-link">setSmoothingObservation</a><wbr>(double timesSeen)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Sets whether this trainer will use smoothing while training the model.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GISModel.html" title="class in opennlp.tools.ml.maxent">GISModel</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#trainModel(int,opennlp.tools.ml.model.DataIndexer)" class="member-name-link">trainModel</a><wbr>(int iterations, |
| <a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model">DataIndexer</a> di)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Trains a model using the GIS algorithm.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GISModel.html" title="class in opennlp.tools.ml.maxent">GISModel</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#trainModel(int,opennlp.tools.ml.model.DataIndexer,int)" class="member-name-link">trainModel</a><wbr>(int iterations, |
| <a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model">DataIndexer</a> di, |
| int threads)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Trains a model using the GIS algorithm.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GISModel.html" title="class in opennlp.tools.ml.maxent">GISModel</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#trainModel(int,opennlp.tools.ml.model.DataIndexer,opennlp.tools.ml.model.Prior,int)" class="member-name-link">trainModel</a><wbr>(int iterations, |
| <a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model">DataIndexer</a> di, |
| <a href="../model/Prior.html" title="interface in opennlp.tools.ml.model">Prior</a> modelPrior, |
| int threads)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Trains a model using the GIS algorithm.</div> |
| </div> |
| <div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GISModel.html" title="class in opennlp.tools.ml.maxent">GISModel</a></code></div> |
| <div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#trainModel(opennlp.tools.util.ObjectStream)" class="member-name-link">trainModel</a><wbr>(<a href="../../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a><<a href="../model/Event.html" title="class in opennlp.tools.ml.model">Event</a>> eventStream)</code></div> |
| <div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Trains a model using the GIS algorithm, assuming 100 iterations and no |
| cutoff.</div> |
| </div> |
| <div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="GISModel.html" title="class in opennlp.tools.ml.maxent">GISModel</a></code></div> |
| <div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#trainModel(opennlp.tools.util.ObjectStream,int,int)" class="member-name-link">trainModel</a><wbr>(<a href="../../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a><<a href="../model/Event.html" title="class in opennlp.tools.ml.model">Event</a>> eventStream, |
| int iterations, |
| int cutoff)</code></div> |
| <div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> |
| <div class="block">Trains a GIS model on the event in the specified event stream, using the specified number |
| of iterations and the specified count cutoff.</div> |
| </div> |
| </div> |
| </div> |
| </div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-opennlp.tools.ml.AbstractEventTrainer">Methods inherited from class opennlp.tools.ml.<a href="../AbstractEventTrainer.html" title="class in opennlp.tools.ml">AbstractEventTrainer</a></h3> |
| <code><a href="../AbstractEventTrainer.html#getDataIndexer(opennlp.tools.util.ObjectStream)">getDataIndexer</a>, <a href="../AbstractEventTrainer.html#train(opennlp.tools.ml.model.DataIndexer)">train</a>, <a href="../AbstractEventTrainer.html#train(opennlp.tools.util.ObjectStream)">train</a>, <a href="../AbstractEventTrainer.html#validate()">validate</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-opennlp.tools.ml.AbstractTrainer">Methods inherited from class opennlp.tools.ml.<a href="../AbstractTrainer.html" title="class in opennlp.tools.ml">AbstractTrainer</a></h3> |
| <code><a href="../AbstractTrainer.html#getAlgorithm()">getAlgorithm</a>, <a href="../AbstractTrainer.html#getCutoff()">getCutoff</a>, <a href="../AbstractTrainer.html#getIterations()">getIterations</a>, <a href="../AbstractTrainer.html#getTrainingConfiguration()">getTrainingConfiguration</a>, <a href="../AbstractTrainer.html#init(opennlp.tools.util.TrainingParameters,java.util.Map,opennlp.tools.util.TrainingConfiguration)">init</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3> |
| <code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div> |
| <div class="inherited-list"> |
| <h3 id="methods-inherited-from-class-opennlp.tools.commons.Trainer">Methods inherited from interface opennlp.tools.commons.<a href="../../commons/Trainer.html" title="interface in opennlp.tools.commons">Trainer</a></h3> |
| <code><a href="../../commons/Trainer.html#init(opennlp.tools.util.TrainingParameters,java.util.Map,opennlp.tools.util.TrainingConfiguration)">init</a></code></div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <section class="details"> |
| <ul class="details-list"> |
| <!-- ============ FIELD DETAIL =========== --> |
| <li> |
| <section class="field-details" id="field-detail"> |
| <h2>Field Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="LOG_LIKELIHOOD_THRESHOLD_PARAM"> |
| <h3>LOG_LIKELIHOOD_THRESHOLD_PARAM</h3> |
| <div class="member-signature"><span class="modifiers">public static final</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">LOG_LIKELIHOOD_THRESHOLD_PARAM</span></div> |
| <dl class="notes"> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="../../../../constant-values.html#opennlp.tools.ml.maxent.GISTrainer.LOG_LIKELIHOOD_THRESHOLD_PARAM">Constant Field Values</a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="LOG_LIKELIHOOD_THRESHOLD_DEFAULT"> |
| <h3>LOG_LIKELIHOOD_THRESHOLD_DEFAULT</h3> |
| <div class="member-signature"><span class="modifiers">public static final</span> <span class="return-type">double</span> <span class="element-name">LOG_LIKELIHOOD_THRESHOLD_DEFAULT</span></div> |
| <dl class="notes"> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="../../../../constant-values.html#opennlp.tools.ml.maxent.GISTrainer.LOG_LIKELIHOOD_THRESHOLD_DEFAULT">Constant Field Values</a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="MAXENT_VALUE"> |
| <h3>MAXENT_VALUE</h3> |
| <div class="member-signature"><span class="modifiers">public static final</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">MAXENT_VALUE</span></div> |
| <dl class="notes"> |
| <dt>See Also:</dt> |
| <dd> |
| <ul class="see-list"> |
| <li><a href="../../../../constant-values.html#opennlp.tools.ml.maxent.GISTrainer.MAXENT_VALUE">Constant Field Values</a></li> |
| </ul> |
| </dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ========= CONSTRUCTOR DETAIL ======== --> |
| <li> |
| <section class="constructor-details" id="constructor-detail"> |
| <h2>Constructor Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="<init>()"> |
| <h3>GISTrainer</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="element-name">GISTrainer</span>()</div> |
| <div class="block">Initializes a <a href="GISTrainer.html" title="class in opennlp.tools.ml.maxent"><code>GISTrainer</code></a>. |
| <p> |
| <b>Note:</b><br> |
| The resulting instance does not print progress messages about training to STDOUT.</div> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| <!-- ============ METHOD DETAIL ========== --> |
| <li> |
| <section class="method-details" id="method-detail"> |
| <h2>Method Details</h2> |
| <ul class="member-list"> |
| <li> |
| <section class="detail" id="isSortAndMerge()"> |
| <h3>isSortAndMerge</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">boolean</span> <span class="element-name">isSortAndMerge</span>()</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../AbstractEventTrainer.html#isSortAndMerge()">isSortAndMerge</a></code> in class <code><a href="../AbstractEventTrainer.html" title="class in opennlp.tools.ml">AbstractEventTrainer</a></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="init(opennlp.tools.util.TrainingParameters,java.util.Map)"> |
| <h3>init</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">init</span><wbr><span class="parameters">(<a href="../../util/TrainingParameters.html" title="class in opennlp.tools.util">TrainingParameters</a> trainingParameters, |
| <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>,<wbr><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>> reportMap)</span></div> |
| <div class="block">Initializes a <a href="../AbstractTrainer.html" title="class in opennlp.tools.ml"><code>AbstractTrainer</code></a> via <a href="../../util/TrainingParameters.html" title="class in opennlp.tools.util"><code>TrainingParameters</code></a> and |
| a <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link"><code>report map</code></a>.</div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../../commons/Trainer.html#init(opennlp.tools.util.TrainingParameters,java.util.Map)">init</a></code> in interface <code><a href="../../commons/Trainer.html" title="interface in opennlp.tools.commons">Trainer</a></code></dd> |
| <dt>Overrides:</dt> |
| <dd><code><a href="../AbstractTrainer.html#init(opennlp.tools.util.TrainingParameters,java.util.Map)">init</a></code> in class <code><a href="../AbstractTrainer.html" title="class in opennlp.tools.ml">AbstractTrainer</a></code></dd> |
| <dt>Parameters:</dt> |
| <dd><code>trainingParameters</code> - The <a href="../../util/TrainingParameters.html" title="class in opennlp.tools.util"><code>TrainingParameters</code></a> to use.</dd> |
| <dd><code>reportMap</code> - The <a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link"><code>Map</code></a> instance used as report map.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="doTrain(opennlp.tools.ml.model.DataIndexer)"> |
| <h3>doTrain</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../model/MaxentModel.html" title="interface in opennlp.tools.ml.model">MaxentModel</a></span> <span class="element-name">doTrain</span><wbr><span class="parameters">(<a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model">DataIndexer</a> indexer)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <dl class="notes"> |
| <dt>Specified by:</dt> |
| <dd><code><a href="../AbstractEventTrainer.html#doTrain(opennlp.tools.ml.model.DataIndexer)">doTrain</a></code> in class <code><a href="../AbstractEventTrainer.html" title="class in opennlp.tools.ml">AbstractEventTrainer</a></code></dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setSmoothing(boolean)"> |
| <h3>setSmoothing</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setSmoothing</span><wbr><span class="parameters">(boolean smooth)</span></div> |
| <div class="block">Sets whether this trainer will use smoothing while training the model. |
| <p> |
| <b>Note:</b><br> |
| This can improve model accuracy, though training will potentially take |
| longer and use more memory. Model size will also be larger.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>smooth</code> - <code>true</code> if smoothing is desired, <code>false</code> if not.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setSmoothingObservation(double)"> |
| <h3>setSmoothingObservation</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setSmoothingObservation</span><wbr><span class="parameters">(double timesSeen)</span></div> |
| <div class="block">Sets whether this trainer will use smoothing while training the model. |
| <p> |
| <b>Note:</b><br> |
| This can improve model accuracy, though training will potentially take |
| longer and use more memory. Model size will also be larger.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>timesSeen</code> - The "number" of times we want the trainer to imagine |
| it saw a feature that it actually didn't see</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="setGaussianSigma(double)"> |
| <h3>setGaussianSigma</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setGaussianSigma</span><wbr><span class="parameters">(double sigmaValue)</span></div> |
| <div class="block">Sets whether this trainer will use smoothing while training the model. |
| <p> |
| <b>Note:</b><br> |
| This can improve model accuracy, though training will potentially take |
| longer and use more memory. Model size will also be larger.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>sigmaValue</code> - The Gaussian sigma value used for smoothing.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="trainModel(opennlp.tools.util.ObjectStream)"> |
| <h3>trainModel</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="GISModel.html" title="class in opennlp.tools.ml.maxent">GISModel</a></span> <span class="element-name">trainModel</span><wbr><span class="parameters">(<a href="../../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a><<a href="../model/Event.html" title="class in opennlp.tools.ml.model">Event</a>> eventStream)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Trains a model using the GIS algorithm, assuming 100 iterations and no |
| cutoff.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>eventStream</code> - The <a href="../../util/ObjectStream.html" title="interface in opennlp.tools.util"><code>eventStream</code></a> holding the data |
| on which this model will be trained.</dd> |
| <dt>Returns:</dt> |
| <dd>A trained <a href="GISModel.html" title="class in opennlp.tools.ml.maxent"><code>GISModel</code></a> which can be used immediately or saved to |
| disk using an <a href="io/GISModelWriter.html" title="class in opennlp.tools.ml.maxent.io"><code>GISModelWriter</code></a>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="trainModel(opennlp.tools.util.ObjectStream,int,int)"> |
| <h3>trainModel</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="GISModel.html" title="class in opennlp.tools.ml.maxent">GISModel</a></span> <span class="element-name">trainModel</span><wbr><span class="parameters">(<a href="../../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a><<a href="../model/Event.html" title="class in opennlp.tools.ml.model">Event</a>> eventStream, |
| int iterations, |
| int cutoff)</span> |
| throws <span class="exceptions"><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></span></div> |
| <div class="block">Trains a GIS model on the event in the specified event stream, using the specified number |
| of iterations and the specified count cutoff.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>eventStream</code> - A <a href="../../util/ObjectStream.html" title="interface in opennlp.tools.util"><code>stream</code></a> of all events.</dd> |
| <dd><code>iterations</code> - The number of iterations to use for GIS.</dd> |
| <dd><code>cutoff</code> - The number of times a feature must occur to be included.</dd> |
| <dt>Returns:</dt> |
| <dd>A trained <a href="GISModel.html" title="class in opennlp.tools.ml.maxent"><code>GISModel</code></a> which can be used immediately or saved to |
| disk using an <a href="io/GISModelWriter.html" title="class in opennlp.tools.ml.maxent.io"><code>GISModelWriter</code></a>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/io/IOException.html" title="class or interface in java.io" class="external-link">IOException</a></code></dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="trainModel(int,opennlp.tools.ml.model.DataIndexer)"> |
| <h3>trainModel</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="GISModel.html" title="class in opennlp.tools.ml.maxent">GISModel</a></span> <span class="element-name">trainModel</span><wbr><span class="parameters">(int iterations, |
| <a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model">DataIndexer</a> di)</span></div> |
| <div class="block">Trains a model using the GIS algorithm.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>iterations</code> - The number of GIS iterations to perform.</dd> |
| <dd><code>di</code> - The <a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model"><code>DataIndexer</code></a> used to compress events in memory.</dd> |
| <dt>Returns:</dt> |
| <dd>A trained <a href="GISModel.html" title="class in opennlp.tools.ml.maxent"><code>GISModel</code></a> which can be used immediately or saved to |
| disk using an <a href="io/GISModelWriter.html" title="class in opennlp.tools.ml.maxent.io"><code>GISModelWriter</code></a>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - Thrown if parameters were invalid.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="trainModel(int,opennlp.tools.ml.model.DataIndexer,int)"> |
| <h3>trainModel</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="GISModel.html" title="class in opennlp.tools.ml.maxent">GISModel</a></span> <span class="element-name">trainModel</span><wbr><span class="parameters">(int iterations, |
| <a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model">DataIndexer</a> di, |
| int threads)</span></div> |
| <div class="block">Trains a model using the GIS algorithm.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>iterations</code> - The number of GIS iterations to perform.</dd> |
| <dd><code>di</code> - The <a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model"><code>DataIndexer</code></a> used to compress events in memory.</dd> |
| <dd><code>threads</code> - The number of thread to train with. Must be greater than <code>0</code>.</dd> |
| <dt>Returns:</dt> |
| <dd>A trained <a href="GISModel.html" title="class in opennlp.tools.ml.maxent"><code>GISModel</code></a> which can be used immediately or saved to |
| disk using an <a href="io/GISModelWriter.html" title="class in opennlp.tools.ml.maxent.io"><code>GISModelWriter</code></a>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - Thrown if parameters were invalid.</dd> |
| </dl> |
| </section> |
| </li> |
| <li> |
| <section class="detail" id="trainModel(int,opennlp.tools.ml.model.DataIndexer,opennlp.tools.ml.model.Prior,int)"> |
| <h3>trainModel</h3> |
| <div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="GISModel.html" title="class in opennlp.tools.ml.maxent">GISModel</a></span> <span class="element-name">trainModel</span><wbr><span class="parameters">(int iterations, |
| <a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model">DataIndexer</a> di, |
| <a href="../model/Prior.html" title="interface in opennlp.tools.ml.model">Prior</a> modelPrior, |
| int threads)</span></div> |
| <div class="block">Trains a model using the GIS algorithm.</div> |
| <dl class="notes"> |
| <dt>Parameters:</dt> |
| <dd><code>iterations</code> - The number of GIS iterations to perform.</dd> |
| <dd><code>di</code> - The <a href="../model/DataIndexer.html" title="interface in opennlp.tools.ml.model"><code>DataIndexer</code></a> used to compress events in memory.</dd> |
| <dd><code>modelPrior</code> - The <a href="../model/Prior.html" title="interface in opennlp.tools.ml.model"><code>Prior</code></a> distribution used to train this model.</dd> |
| <dt>Returns:</dt> |
| <dd>A trained <a href="GISModel.html" title="class in opennlp.tools.ml.maxent"><code>GISModel</code></a> which can be used immediately or saved to |
| disk using an <a href="io/GISModelWriter.html" title="class in opennlp.tools.ml.maxent.io"><code>GISModelWriter</code></a>.</dd> |
| <dt>Throws:</dt> |
| <dd><code><a href="https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - Thrown if parameters were invalid.</dd> |
| </dl> |
| </section> |
| </li> |
| </ul> |
| </section> |
| </li> |
| </ul> |
| </section> |
| <!-- ========= END OF CLASS DATA ========= --> |
| </main> |
| <footer role="contentinfo"> |
| <hr> |
| <p class="legal-copy"><small>Copyright © 2025 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p> |
| </footer> |
| </div> |
| </div> |
| </body> |
| </html> |