I have this code that works for English language but does not work for Persian language
from gensim.models import Word2Vec as wv
for sentence in sentences:
tokens = sentence.strip().lower().split(" ")
tokenized.append(tokens)
model = wv(tokenized
,size=5,
min_count=1)
print('done2')
model.save('F:/text8/text8-phrases1')
print('done3')
print(model)
model = wv.load('F:/text8/text8-phrases1')
print(model.wv.vocab)
output
> 'بر': <gensim.models.keyedvectors.Vocab object at 0x0000027716EEB0B8>,
> 'اساس': <gensim.models.keyedvectors.Vocab object at
> 0x0000027716EEB160>, 'قوانين': <gensim.models.keyedvectors.Vocab
> object at 0x0000027716EEB198>, 'دانشگاه':
> <gensim.models.keyedvectors.Vocab object at 0x0000027716EEB1D0>,
> 'اصفهان،': <gensim.models.keyedvectors.Vocab object at
> 0x0000027716EEB208>, 'نويسنده': <gensim.models.keyedvectors.Vocab
> object at 0x0000027716EEB240>, 'مسؤول':
> <gensim.models.keyedvectors.Vocab object at 0x0000027716EEB278>,
> 'مقاله': <gensim.models.keyedvectors.Vocab object at
> 0x0000027716EEB2B0>, 'بايد'
plesae take example with code thanks
text8-phrases1
? It could be a problem if your input doesn't use spaces or if there's not enough text. – Holley