API Reference¶
The semanticizest API is not stable and may change without notice.
Semanticizest¶
- class semanticizest.Semanticizer(fname)¶
Entity linker.
This is the main class for using Semanticizest. It’s a handle on a statistical model that lives on disk.
Parameters: fname : string
Filename of the stored model from which to load the Wikipedia statistics. Loading is lazy; the underlying file should not be modified while any Semanticizer is using it.
Methods
all_candidates(s) Retrieve all candidate entities from a piece of text. - all_candidates(s)¶
Retrieve all candidate entities from a piece of text.
Parameters: s : {string, iterable over string}
Tokens. If a string, it will be tokenized using a naive heuristic.
Returns: candidates : iterable over (int, int, string, float)
Candidate entities are 4-tuples of the indices start and end (both in tokenized input, and both start at 1), target entity (title of the Wikipedia article) and probability (commonness.)