class documentation
A sense in BabelNet, contained in a BabelSynset.
Method | __init__ |
init method |
Method | synset |
Set the synset the sense belongs to. |
Method | to |
Return the URI of the sense for a given ExternalResource. |
Instance Variable | full |
The full lemma for this sense. |
Instance Variable | id |
The id of the sense in the SQL database. |
Instance Variable | language |
The language of this sense. |
Instance Variable | normalized |
The normalized lemma for this sense (lowercase, without parentheses, etc.). |
Instance Variable | pos |
The part-of-speech of this sense. |
Instance Variable | pronunciations |
The set of the audio pronunciations. |
Instance Variable | sensekey |
Undocumented |
Instance Variable | source |
The source of this lemma: WordNet, Wikipedia, translation, etc. |
Instance Variable | synset |
The synset id this sense belongs to. |
Property | is |
True if the sense is the result of an automatic translation. |
Property | is |
True if it is a key sense. |
Property | is |
Returns True if the sense is NOT the result of an automatic translation. |
Property | lemma |
Get the lemma of this BabelSense |
Property | license |
The license for this Babel sense. |
Property | sense |
A String-based representation of this BabelSense alternative to the "canonical" one obtained using __str__. This corresponds to a diesis-like representation if the sense belongs to WordNet, e.g. 'car#n#1'... |
Property | synset |
The synset the sense belongs to. |
Method | __eq__ |
Undocumented |
Method | __hash__ |
Undocumented |
Method | __repr__ |
Undocumented |
Method | __str__ |
Undocumented |
Method | _get |
Get a link to the corresponding DBPedia URI (None if no interlinking is available or possible). |
Method | _get |
Get a link to the corresponding GeoNames URI (None if no interlinking is available or possible). |
Method | _get |
Get a link to the corresponding YAGO URI (None if no interlinking is available or possible). |
Constant | _DBPEDIA |
The prefix of DBPedia URIs. |
Constant | _YAGO |
The prefix of YAGO3 URIs. |
Instance Variable | _key |
The sensekey of the OmegaWiki, Wikidata, Wiktionary, GeoName, MSTERM or VerbNet sense to which this sense corresponds, if any. |
Instance Variable | _lemma |
the lemma |
Instance Variable | _synset |
The synset this sense belongs to. |
Instance Variable | _yago |
the yago url |
def __init__(self, lemma, language, pos, source, sensekey, synset, *, key_sense=False, yago_url=None, phonetics=None):
overridden in
babelnet.sense.WordNetSense
init method
Parameters | |
lemma:str | The full lemma for this sense. |
language:Language | The language of this sense. |
pos:POS | The part-of-speech of this sense. |
source:BabelSenseSource | The source of this lemma: WordNet, Wikipedia, translation, etc. |
sensekey:str | The sensekey of the OmegaWiki, Wikidata, Wiktionary, GeoName, MSTERM or VerbNet sense to which this sense corresponds, if any. |
synset:BabelSynset | The synset this sense belongs to. |
keybool | True if it is a key sense (default False). |
yagostr | A link to the corresponding YAGO URI (default None). |
phonetics:BabelSensePhonetics | The set of the audio pronunciations (default None. |
def to_uri(self, resource):
Return the URI of the sense for a given ExternalResource.
Parameters | |
resource:BabelExternalResource | The external resource. |
Returns | |
Optional[str] | The URI to the external resource. |
overridden in
babelnet.sense.WordNetSense
A String-based representation of this BabelSense alternative to the "canonical" one obtained using __str__. This corresponds to a diesis-like representation if the sense belongs to WordNet, e.g. 'car#n#1' or 'funk#n#3', or the page otherwise the lemma.
def _get_dbpedia_uri(self):
Get a link to the corresponding DBPedia URI (None if no interlinking is available or possible).
See also: DBPedia interlinking
Returns | |
Optional[ | A link to the corresponding DBPedia URI. |