bheinzerling / bpemb

Pre-trained subword embeddings in 275 languages, based on Byte-Pair Encoding (BPE)
https://nlp.h-its.org/bpemb
MIT License
1.18k stars 101 forks source link

most_similar method #27

Closed trideeprath closed 5 years ago

trideeprath commented 5 years ago

Using the Readme it's not clear how to use the most_similar functionality.

>>> bpemb_en.most_similar("ford") Traceback (most recent call last): File "", line 1, in AttributeError: 'BPEmb' object has no attribute 'most_similar'

>>> bpemb_en.emb.most_similar("ford", topn=5)
[('ley', 0.7945780754089355), ('bury', 0.7869017124176025), ('ton', 0.733354389667511), ('brook', 0.7124956250190735), ('field', 0.7107075452804565)]
bheinzerling commented 5 years ago

Thanks for reporting this. I fixed this a while ago in the github repository but forgot to upload a new version to pypi. Will do so soon.