Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyerror for words not in vocabulary #54

Open
appledora opened this issue Jul 26, 2020 · 1 comment
Open

Keyerror for words not in vocabulary #54

appledora opened this issue Jul 26, 2020 · 1 comment

Comments

@appledora
Copy link

I am using a list of list for the seed words which contains some words that may not be present in the dataset. I am getting a one line "Keyerror : "পেশী" for this. I tried using try-catch in the following manner:
`for t_id, st in enumerate(seed_topic_list):

for word in st:

    try:

        seed_topics[word2id_[word]] = t_id

    except KeyError:

        print ("not in vocabulary")

        seed_topics[word2id_[word]]  = 0`

still not working. So , should I just train my Countvectorizer with the seed words?

@sonamgupta1105
Copy link

@vi3k6i5 I am having the similar KeyError. Any suggestions how to fix it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants