spaCy icon indicating copy to clipboard operation
spaCy copied to clipboard

source of word probability

Open rajhans opened this issue 10 years ago • 3 comments

Hello

Can you share the name of the corpus you use to compute the word probabilities? Also is it possible to set custom word probabilities?

I am thinking of using word prob in lieu of IDF and just want to know the source of the data. I am guessing your probabilities are computed from raw term counts which is not exactly compatible with counts of documents containing the term, but that's a separate issue.

Thanks!

rajhans avatar Oct 28 '16 22:10 rajhans

The probabilities derive from Good-Turing smoothed counts estimated on the Reddit Comment Corpus.

You can override the .prob estimates by iterating over the vocabulary, and assigning to the lexemes:

for lex in nlp.vocab:
    lex.prob = your_probs[lex.orth]

honnibal avatar Oct 28 '16 22:10 honnibal

Great... thanks!

rajhans avatar Oct 28 '16 22:10 rajhans

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

lock[bot] avatar May 09 '18 07:05 lock[bot]