sigpwned / berkeleylm

Automatically exported from code.google.com/p/berkeleylm
0 stars 0 forks source link

Frequency Map #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Good Afternoon,

How to generate a map of frequency of n-grams?

Thank you.

Original issue reported on code.google.com by alexport...@gmail.com on 8 Dec 2014 at 4:48

GoogleCodeExporter commented 8 years ago
Depends what you mean. If you want to get frequency of n-grams from raw text, 
we don't support that. If you want an efficient in-memory representation of 
some n-gram counts that you have already put in Google n-grams format, then you 
can build a StupidBackOffLm and get access to the underlying counts using:

https://code.google.com/p/berkeleylm/source/browse/trunk/src/edu/berkeley/nlp/lm
/StupidBackoffLm.java#132

See here for an example:

https://code.google.com/p/berkeleylm/source/browse/trunk/src/edu/berkeley/nlp/lm
/io/MakeNgramMapBinaryFromGoogle.java#40
'
Let me now if you need further help.

Original comment by adpa...@gmail.com on 9 Dec 2014 at 1:35