Skip to content

Conversation

@c-martinez
Copy link
Contributor

Alternative way of converting counts to probabilities (as suggested by #13 ).

In the following example, entities like: Chiliometrum, Magnum opus, Litus, Occidens, Septentrio, etc, are assigned 1.0 probability when using 'simple' count conversion, but get different probabilities when using 'wilson' method.

import re
from semanticizest import Semanticizer

sem = Semanticizer('la.model', score='wilson', wilson_confidence=0.95)

text = """Area 389.434 km² Naxos est maxima Cycladum insula. Insulae orientali sunt litora ardua, in occidentem versus loca planiora patent, a septentrionibus ad meridiem montes granitici insulam transeunt, qui usque ad 1000 metra surgunt; quorum summa cacumina sunt Mons Iovis et Coronus."""
toks = re.findall('\w+', text)

for cand in sem.all_candidates(toks):
   print cand

However, it is significantly slower.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should add scipy to requirements.txt.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants