This module sets the api type (RPC/ONLINE/OFFLINE). It also contains the list of functions implemented by the BabelNet API.
| Function | version |
Get the version of loaded BabelNet indices. |
| Variable | get |
Get the senses of synsets searched by words or by ResourceIDs, satisfying the optional constraints. |
| Variable | get |
Get the senses of synsets containing the word with the given constraints. |
| Variable | get |
Get the senses of synsets from the word with the given constraints. |
| Variable | get |
Return the synset identified by the ResourceID in input. |
| Variable | get |
Get synsets by words or by ResourceIDs, satisfying the optional constraints. |
| Variable | iterator |
Create a new instance of BabelSynset iterator (unavailable in online mode). |
| Variable | lexicon |
Create a new instance of a lexicon iterator (unavailable in online mode). |
| Variable | offset |
Create a new instance of an offset iterator (unavailable in online mode). |
| Variable | to |
Convert from ResourceID to the corresponding BabelSynset. |
| Variable | wordnet |
Create a new instance of a WordNet iterator (unavailable in online mode). |
| Variable | _api |
the api instance |
| Variable | _api |
the type of the api. |
| Variable | _log |
logger |
| Variable | _version |
The version of the api |
Get the version of loaded BabelNet indices.
| Returns | |
BabelVersion | The BabelVersion of BabelNet indices. |
AbstractAPI.get_senses =
Get the senses of synsets searched by words or by ResourceIDs, satisfying the optional constraints.
AbstractAPI.get_senses_containing =
Get the senses of synsets containing the word with the given constraints.
AbstractAPI.get_senses_from =
Get the senses of synsets from the word with the given constraints.
AbstractAPI.get_synset =
Return the synset identified by the ResourceID in input.
Some examples that can be used follow:
import babelnet as bn
# Retrieving BabelSynset from a Wikipedia page title:
synset = bn.get_synset(WikipediaID('BabelNet', Language.EN, POS.NOUN))
# Retrieving BabelSynset from a WordNet id:
synset = bn.get_synset(WordNetSynsetID('wn:03544360n'))
# Retrieving BabelSynset from a Wikidata page id:
synset = bn.get_synset(WikidataID('Q4837690'))
# Retrieving BabelSynset from a OmegaWiki page id:
synset = bn.get_synset(OmegaWikiID('1499705'))
AbstractAPI.get_synsets =
Get synsets by words or by ResourceIDs, satisfying the optional constraints.
AbstractAPI.iterator =
Create a new instance of BabelSynset iterator (unavailable in online mode).
AbstractAPI.lexicon_iterator =
Create a new instance of a lexicon iterator (unavailable in online mode).
AbstractAPI.offset_iterator =
Create a new instance of an offset iterator (unavailable in online mode).
AbstractAPI.wordnet_iterator =
Create a new instance of a WordNet iterator (unavailable in online mode).