namebot.nlp module

Functions that use Natural Language Processing.

Word relationships found (via NLTK and other libraries) to find and generate related words.

namebot.nlp.get_also_sees(synset, use_definitions=False)[source]

Extract also-sees from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_attributes(synset, use_definitions=False)[source]

Extract attributes from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_causes(synset, use_definitions=False)[source]

Extract causes from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_entailments(synset, use_definitions=False)[source]

Extract entailments from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_hypernyms(synset, use_definitions=False)[source]

Extract hypernyms from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_hyponyms(synset, use_definitions=False)[source]

Extract hyponyms from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_inst_hyponyms(synset, use_definitions=False)[source]

Extract instance hyponyms from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_instance_hypernyms(synset, use_definitions=False)[source]

Extract instance hypernyms from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_member_holoynms(synset, use_definitions=False)[source]

Extract member holonyms from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_member_meronyms(synset, use_definitions=False)[source]

Extract meronyms from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_part_holoynms(synset, use_definitions=False)[source]

Extract part holonyms from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_part_meronyms(synset, use_definitions=False)[source]

Extract part meronyms from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_region_domains(synset, use_definitions=False)[source]

Extract region domains from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_similartos(synset, use_definitions=False)[source]

Extract similar-tos from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_substance_holoynms(synset, use_definitions=False)[source]

Extract substance holoynms from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_substance_meronyms(synset, use_definitions=False)[source]

Extract substance meronyms from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_synset_definitions(word)[source]

Return all possible definitions for synsets in a word synset ring.

Args:
word (str): The word to lookup.
Returns:
definitions (list): The synset definitions list.
namebot.nlp.get_synsets(words, use_definitions=False, clean=False)[source]

Brute force loop on a synset ring to get all related words.

You are expected to filter or remove any that are not relevant separately, if the resultant set is too long. The scoring module provides tools to filter based on pronunciation, but you can write your own and extend the functionality.

Args:

words (list): The list of words. use_definitions (bool, optional): Determine if definition words

should also be extracted.
clean (bool, optional): Determine if set should be de-duped,
cleaned, etc...
Returns:
results (dict): The results dictionary.
namebot.nlp.get_synsets_definitions(words)[source]

Return all possible definitions for all synsets in the synset ring.

Args:
words (list): The list of words.
Returns:
sets (list): The synsets.
namebot.nlp.get_topic_domains(synset, use_definitions=False)[source]

Extract topic domains from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_usage_domains(synset, use_definitions=False)[source]

Extract usage domains from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_verb_groups(synset, use_definitions=False)[source]

Extract verb groups from a synset.

Args:
synset (object): The synset instance. use_definitions (bool, optional): Extract definitions from the synset.
Returns:
list: The results list.
namebot.nlp.get_verb_lemmas(verbs)[source]

Return verbnet lemmas for the given verbs.

These verbs are stemmed before lookup to prevent empty results.

Args:
verbs (list) - The list of verbs (verbs) to reference.
Returns:
lemmas (list) - A list of lemmas for all verbs
  • these are not separated by verb.
namebot.nlp.get_word_synsets(word)[source]

Get all synsets for a word.

Args:
word (str): The word to lookup.
Returns:
object: The synset ring instance.
namebot.nlp.print_all_synset_categories()[source]

Print all domains and categories for research purposes.

Returns:
categories (list): A list of all wordnet synsets.