Java Reference
In-Depth Information
If we modify the statement to use a different model file, we can see how they work against
the sample sentences:
InputStream modelStream = new FileInputStream(
new File(getModelDir(), "en-ner-time.bin"));) {
Note
When the en-ner-money.bin model is used, the index in the tokens array in the
earlier code sequence has to be increased by one. Otherwise, all that is returned is the dol-
lar sign.
The various outputs are shown in the following table.
Model
Output
Span: [4..5) location
Entity: Boston
Probability: 0.8656908776583051
en-ner-location.bin
Span: [5..6) location
Entity: Vermont
Probability: 0.9732488014011262
Span: [14..16) money
en-ner-money.bin
Entity: 2.45
Probability: 0.7200919701507937
Span: [16..17) organization
en-ner-organization.bin
Entity: IBM
Probability: 0.9256970736336729
en-ner-time.bin
The model was not able to detect time in this text sequence
The model failed to find the time entities in the sample text. This illustrates that the model
did not have enough confidence that it found any time entities in the text.
Search WWH ::




Custom Search