blob: 781fa4518e37b4296959a13e089705a8f8efd633 [file] [log] [blame]
<!DOCTYPE HTML>
<html lang>
<head>
<!-- Generated by javadoc (17) -->
<title>NameFinderME (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.namefind, class: NameFinderME">
<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:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li><a href="#field-summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method-summary">Method</a></li>
</ul>
<ul class="sub-nav-list">
<li>Detail:&nbsp;</li>
<li><a href="#field-detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor-detail">Constr</a>&nbsp;|&nbsp;</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>&nbsp;<a href="package-summary.html">opennlp.tools.namefind</a></div>
<h1 title="Class NameFinderME" class="title">Class NameFinderME</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">opennlp.tools.namefind.NameFinderME</div>
</div>
<section class="class-description" id="class-description">
<dl class="notes">
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="../ml/Probabilistic.html" title="interface in opennlp.tools.ml">Probabilistic</a></code>, <code><a href="TokenNameFinder.html" title="interface in opennlp.tools.namefind">TokenNameFinder</a></code></dd>
</dl>
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">NameFinderME</span>
<span class="extends-implements">extends <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>
implements <a href="TokenNameFinder.html" title="interface in opennlp.tools.namefind">TokenNameFinder</a>, <a href="../ml/Probabilistic.html" title="interface in opennlp.tools.ml">Probabilistic</a></span></div>
<div class="block">A maximum-entropy-based <a href="TokenNameFinder.html" title="interface in opennlp.tools.namefind"><code>name finder</code></a> implementation.</div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../ml/Probabilistic.html" title="interface in opennlp.tools.ml"><code>Probabilistic</code></a></li>
<li><a href="TokenNameFinder.html" title="interface in opennlp.tools.namefind"><code>TokenNameFinder</code></a></li>
</ul>
</dd>
</dl>
</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 <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="#CONTINUE" class="member-name-link">CONTINUE</a></code></div>
<div class="col-last even-row-color">&nbsp;</div>
<div class="col-first odd-row-color"><code>static final int</code></div>
<div class="col-second odd-row-color"><code><a href="#DEFAULT_BEAM_SIZE" class="member-name-link">DEFAULT_BEAM_SIZE</a></code></div>
<div class="col-last odd-row-color">&nbsp;</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="#OTHER" class="member-name-link">OTHER</a></code></div>
<div class="col-last even-row-color">&nbsp;</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="#START" class="member-name-link">START</a></code></div>
<div class="col-last odd-row-color">&nbsp;</div>
</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(opennlp.tools.namefind.TokenNameFinderModel)" class="member-name-link">NameFinderME</a><wbr>(<a href="TokenNameFinderModel.html" title="class in opennlp.tools.namefind">TokenNameFinderModel</a>&nbsp;model)</code></div>
<div class="col-last even-row-color">
<div class="block">Initializes a <a href="NameFinderME.html" title="class in opennlp.tools.namefind"><code>NameFinderME</code></a> with a <a href="TokenNameFinderModel.html" title="class in opennlp.tools.namefind"><code>TokenNameFinderModel</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-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static 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>void</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clearAdaptiveData()" class="member-name-link">clearAdaptiveData</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Forgets all adaptive data which was collected during previous
calls to one of the find methods.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="../util/Span.html" title="class in opennlp.tools.util">Span</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#dropOverlappingSpans(opennlp.tools.util.Span%5B%5D)" class="member-name-link">dropOverlappingSpans</a><wbr>(<a href="../util/Span.html" title="class in opennlp.tools.util">Span</a>[]&nbsp;spans)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Removes <a href="../util/Span.html" title="class in opennlp.tools.util"><code>spans</code></a> with are intersecting or crossing in any way.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../util/Span.html" title="class in opennlp.tools.util">Span</a>[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#find(java.lang.String%5B%5D)" class="member-name-link">find</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>[]&nbsp;tokens)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Generates name tags for the given sequence, typically a sentence,
returning <a href="../util/Span.html" title="class in opennlp.tools.util"><code>token spans</code></a> for any identified names.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../util/Span.html" title="class in opennlp.tools.util">Span</a>[]</code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#find(java.lang.String%5B%5D,java.lang.String%5B%5D%5B%5D)" class="member-name-link">find</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>[]&nbsp;tokens,
<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>[][]&nbsp;additionalContext)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Generates name tags for the given sequence, typically a sentence, returning
<a href="../util/Span.html" title="class in opennlp.tools.util"><code>token spans</code></a> for any identified names.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#probs()" class="member-name-link">probs</a>()</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Retrieves the probabilities of the last decoded sequence.</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="#probs(double%5B%5D)" class="member-name-link">probs</a><wbr>(double[]&nbsp;probs)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Populates the specified array with the probabilities of the last decoded
sequence.</div>
</div>
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>double[]</code></div>
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#probs(opennlp.tools.util.Span%5B%5D)" class="member-name-link">probs</a><wbr>(<a href="../util/Span.html" title="class in opennlp.tools.util">Span</a>[]&nbsp;spans)</code></div>
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4">
<div class="block">Retrieves an array of probabilities for each of the specified spans which is
the arithmetic mean of the probabilities for each of the outcomes which
make up the span.</div>
</div>
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="TokenNameFinderModel.html" title="class in opennlp.tools.namefind">TokenNameFinderModel</a></code></div>
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#train(java.lang.String,java.lang.String,opennlp.tools.util.ObjectStream,opennlp.tools.util.TrainingParameters,opennlp.tools.namefind.TokenNameFinderFactory)" class="member-name-link">train</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>&nbsp;languageCode,
<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>&nbsp;type,
<a href="../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a>&lt;<a href="NameSample.html" title="class in opennlp.tools.namefind">NameSample</a>&gt;&nbsp;samples,
<a href="../util/TrainingParameters.html" title="class in opennlp.tools.util">TrainingParameters</a>&nbsp;params,
<a href="TokenNameFinderFactory.html" title="class in opennlp.tools.namefind">TokenNameFinderFactory</a>&nbsp;factory)</code></div>
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
<div class="block">Starts a training of a <a href="TokenNameFinderModel.html" title="class in opennlp.tools.namefind"><code>TokenNameFinderModel</code></a> with the given parameters.</div>
</div>
</div>
</div>
</div>
<div class="inherited-list">
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class&nbsp;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>
</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="DEFAULT_BEAM_SIZE">
<h3>DEFAULT_BEAM_SIZE</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<span class="return-type">int</span>&nbsp;<span class="element-name">DEFAULT_BEAM_SIZE</span></div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../constant-values.html#opennlp.tools.namefind.NameFinderME.DEFAULT_BEAM_SIZE">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="START">
<h3>START</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<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>&nbsp;<span class="element-name">START</span></div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../constant-values.html#opennlp.tools.namefind.NameFinderME.START">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="CONTINUE">
<h3>CONTINUE</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<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>&nbsp;<span class="element-name">CONTINUE</span></div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../constant-values.html#opennlp.tools.namefind.NameFinderME.CONTINUE">Constant Field Values</a></li>
</ul>
</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="OTHER">
<h3>OTHER</h3>
<div class="member-signature"><span class="modifiers">public static final</span>&nbsp;<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>&nbsp;<span class="element-name">OTHER</span></div>
<dl class="notes">
<dt>See Also:</dt>
<dd>
<ul class="see-list">
<li><a href="../../../constant-values.html#opennlp.tools.namefind.NameFinderME.OTHER">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="&lt;init&gt;(opennlp.tools.namefind.TokenNameFinderModel)">
<h3>NameFinderME</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="element-name">NameFinderME</span><wbr><span class="parameters">(<a href="TokenNameFinderModel.html" title="class in opennlp.tools.namefind">TokenNameFinderModel</a>&nbsp;model)</span></div>
<div class="block">Initializes a <a href="NameFinderME.html" title="class in opennlp.tools.namefind"><code>NameFinderME</code></a> with a <a href="TokenNameFinderModel.html" title="class in opennlp.tools.namefind"><code>TokenNameFinderModel</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>model</code> - The <a href="TokenNameFinderModel.html" title="class in opennlp.tools.namefind"><code>TokenNameFinderModel</code></a> to initialize with.</dd>
</dl>
</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="find(java.lang.String[])">
<h3>find</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../util/Span.html" title="class in opennlp.tools.util">Span</a>[]</span>&nbsp;<span class="element-name">find</span><wbr><span class="parameters">(<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>[]&nbsp;tokens)</span></div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="TokenNameFinder.html#find(java.lang.String%5B%5D)">TokenNameFinder</a></code></span></div>
<div class="block">Generates name tags for the given sequence, typically a sentence,
returning <a href="../util/Span.html" title="class in opennlp.tools.util"><code>token spans</code></a> for any identified names.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="TokenNameFinder.html#find(java.lang.String%5B%5D)">find</a></code>&nbsp;in interface&nbsp;<code><a href="TokenNameFinder.html" title="interface in opennlp.tools.namefind">TokenNameFinder</a></code></dd>
<dt>Parameters:</dt>
<dd><code>tokens</code> - An array of the tokens or words of the sequence, typically a sentence.</dd>
<dt>Returns:</dt>
<dd>An array of <a href="../util/Span.html" title="class in opennlp.tools.util"><code>spans</code></a> for each of the names identified.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="find(java.lang.String[],java.lang.String[][])">
<h3>find</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type"><a href="../util/Span.html" title="class in opennlp.tools.util">Span</a>[]</span>&nbsp;<span class="element-name">find</span><wbr><span class="parameters">(<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>[]&nbsp;tokens,
<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>[][]&nbsp;additionalContext)</span></div>
<div class="block">Generates name tags for the given sequence, typically a sentence, returning
<a href="../util/Span.html" title="class in opennlp.tools.util"><code>token spans</code></a> for any identified names.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>tokens</code> - An array of the tokens or words of a sequence, typically a sentence.</dd>
<dd><code>additionalContext</code> - Features which are based on context outside of the
sentence but which should also be used.</dd>
<dt>Returns:</dt>
<dd>An array of <a href="../util/Span.html" title="class in opennlp.tools.util"><code>token spans</code></a> for each of the names identified.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="clearAdaptiveData()">
<h3>clearAdaptiveData</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">clearAdaptiveData</span>()</div>
<div class="block"><span class="descfrm-type-label">Description copied from interface:&nbsp;<code><a href="TokenNameFinder.html#clearAdaptiveData()">TokenNameFinder</a></code></span></div>
<div class="block">Forgets all adaptive data which was collected during previous
calls to one of the find methods.
<p>
Note:
This method should typically be called at the end of the processing of a document.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="TokenNameFinder.html#clearAdaptiveData()">clearAdaptiveData</a></code>&nbsp;in interface&nbsp;<code><a href="TokenNameFinder.html" title="interface in opennlp.tools.namefind">TokenNameFinder</a></code></dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="probs(double[])">
<h3>probs</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">void</span>&nbsp;<span class="element-name">probs</span><wbr><span class="parameters">(double[]&nbsp;probs)</span></div>
<div class="block">Populates the specified array with the probabilities of the last decoded
sequence. The sequence was determined based on the previous call to
<a href="#find(java.lang.String%5B%5D)"><code>find(String[])</code></a>. The specified array should be at least as large as the
number of tokens in the previous call to <a href="#find(java.lang.String%5B%5D)"><code>find(String[])</code></a>.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>probs</code> - An array with the probabilities of the last decoded sequence.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="probs()">
<h3>probs</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double[]</span>&nbsp;<span class="element-name">probs</span>()</div>
<div class="block">Retrieves the probabilities of the last decoded sequence.
The sequence was determined based on the previous call to <a href="#find(java.lang.String%5B%5D)"><code>find(String[])</code></a>.</div>
<dl class="notes">
<dt>Specified by:</dt>
<dd><code><a href="../ml/Probabilistic.html#probs()">probs</a></code>&nbsp;in interface&nbsp;<code><a href="../ml/Probabilistic.html" title="interface in opennlp.tools.ml">Probabilistic</a></code></dd>
<dt>Returns:</dt>
<dd>An array with the same number of probabilities as tokens were sent
to <a href="#find(java.lang.String%5B%5D)"><code>find(String[])</code></a> when it was last called.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="probs(opennlp.tools.util.Span[])">
<h3>probs</h3>
<div class="member-signature"><span class="modifiers">public</span>&nbsp;<span class="return-type">double[]</span>&nbsp;<span class="element-name">probs</span><wbr><span class="parameters">(<a href="../util/Span.html" title="class in opennlp.tools.util">Span</a>[]&nbsp;spans)</span></div>
<div class="block">Retrieves an array of probabilities for each of the specified spans which is
the arithmetic mean of the probabilities for each of the outcomes which
make up the span.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>spans</code> - The <a href="../util/Span.html" title="class in opennlp.tools.util"><code>spans</code></a> of the names for which probabilities
are requested.</dd>
<dt>Returns:</dt>
<dd>An array of probabilities for each of the specified spans.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="train(java.lang.String,java.lang.String,opennlp.tools.util.ObjectStream,opennlp.tools.util.TrainingParameters,opennlp.tools.namefind.TokenNameFinderFactory)">
<h3>train</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="TokenNameFinderModel.html" title="class in opennlp.tools.namefind">TokenNameFinderModel</a></span>&nbsp;<span class="element-name">train</span><wbr><span class="parameters">(<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>&nbsp;languageCode,
<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>&nbsp;type,
<a href="../util/ObjectStream.html" title="interface in opennlp.tools.util">ObjectStream</a>&lt;<a href="NameSample.html" title="class in opennlp.tools.namefind">NameSample</a>&gt;&nbsp;samples,
<a href="../util/TrainingParameters.html" title="class in opennlp.tools.util">TrainingParameters</a>&nbsp;params,
<a href="TokenNameFinderFactory.html" title="class in opennlp.tools.namefind">TokenNameFinderFactory</a>&nbsp;factory)</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">Starts a training of a <a href="TokenNameFinderModel.html" title="class in opennlp.tools.namefind"><code>TokenNameFinderModel</code></a> with the given parameters.</div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>languageCode</code> - The ISO conform language code.</dd>
<dd><code>type</code> - The type to use.</dd>
<dd><code>samples</code> - The <a href="../util/ObjectStream.html" title="interface in opennlp.tools.util"><code>ObjectStream</code></a> of <a href="NameSample.html" title="class in opennlp.tools.namefind"><code>NameSample</code></a> used as input for training.</dd>
<dd><code>params</code> - The <a href="../util/TrainingParameters.html" title="class in opennlp.tools.util"><code>TrainingParameters</code></a> for the context of the training.</dd>
<dd><code>factory</code> - The <a href="TokenNameFinderFactory.html" title="class in opennlp.tools.namefind"><code>TokenNameFinderFactory</code></a> for creating related objects defined
via <code>params</code>.</dd>
<dt>Returns:</dt>
<dd>A valid, trained <a href="TokenNameFinderModel.html" title="class in opennlp.tools.namefind"><code>TokenNameFinderModel</code></a> instance.</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> - Thrown if IO errors occurred during training.</dd>
</dl>
</section>
</li>
<li>
<section class="detail" id="dropOverlappingSpans(opennlp.tools.util.Span[])">
<h3>dropOverlappingSpans</h3>
<div class="member-signature"><span class="modifiers">public static</span>&nbsp;<span class="return-type"><a href="../util/Span.html" title="class in opennlp.tools.util">Span</a>[]</span>&nbsp;<span class="element-name">dropOverlappingSpans</span><wbr><span class="parameters">(<a href="../util/Span.html" title="class in opennlp.tools.util">Span</a>[]&nbsp;spans)</span></div>
<div class="block">Removes <a href="../util/Span.html" title="class in opennlp.tools.util"><code>spans</code></a> with are intersecting or crossing in any way.
<p>
The following rules are used to remove the spans:<br>
Identical spans: The first span in the array after sorting it remains.<br>
Intersecting spans: The first span after sorting remains.<br>
Contained spans: All spans which are contained by another are removed.<br></div>
<dl class="notes">
<dt>Parameters:</dt>
<dd><code>spans</code> - The input <a href="../util/Span.html" title="class in opennlp.tools.util"><code>spans</code></a>.</dd>
<dt>Returns:</dt>
<dd>The resulting non-overlapping <a href="../util/Span.html" title="class in opennlp.tools.util"><code>spans</code></a>.</dd>
</dl>
</section>
</li>
</ul>
</section>
</li>
</ul>
</section>
<!-- ========= END OF CLASS DATA ========= -->
</main>
<footer role="contentinfo">
<hr>
<p class="legal-copy"><small>Copyright &#169; 2025 <a href="https://www.apache.org/">The Apache Software Foundation</a>. All rights reserved.</small></p>
</footer>
</div>
</div>
</body>
</html>