poincare_train module

poincare_train.poincare_closer_then(poincare_model, word1, word2)[source]

Return the list of words closer to word1 in comparison with word2

Parameters:
  • word1 (str) – first word
  • word2 (str) – second word
Returns:

The list of segmented words

Return type:

closer_list (list)

poincare_train.poincare_closest_child(poincare_model, word)[source]

Return the closet child node for a given word

Parameters:word (str) – arbitrary word
Returns:The closest child word in Wordnet format
Return type:child_word (str)
poincare_train.poincare_closest_parent(poincare_model, word)[source]

Return the closet parent node for a given word

Parameters:word (str) – arbitrary word
Returns:The closest parent word in Wordnet format
Return type:child_word (str)
poincare_train.poincare_simmilar(poincare_model, word)[source]

Return the list of words closest to word

Parameters:
  • poincare_model (model object) – The trained poincare model to use
  • word (str) – The word used for finding similar words list
Returns:

The list of similar words

Return type:

most_simmilar_set (list)

poincare_train.poincare_train(hypertouple_dataset, size=2, burn_in=0, epochs=5, print_freq=100)[source]

Train a poincare embedding

Parameters:
  • hypertouple_dataset (list) – The hypertouple dataset to feed for training
  • size (int) – size of model
  • burn_in (int) – Burnin identifier
  • epochs (int) – Number of epochs to train
  • print_freq (int) – Update frequency number
Returns:

The trained Poincare Model

Return type:

poincare_model (model object)

poincare_train.poincare_word_dist(poincare_model, word1, word2)[source]

Return the distance of words between word1 and word2

Parameters:
  • word1 (str) – first word
  • word2 (str) – second word
Returns:

The list of segmented words

Return type:

dist (float)