Comments (3)
Do you need this access to be fast? I have some functionality which you can
access by doing:
new NgramMapWrapper<W, LongRef>(lm.getNgramMap(), lm.getWordIndexer());
on a StupidBackoffLm. This gives a Map from List<W> to LongRefs. However, this
interface is slow due to all the boxing/unboxing.
Original comment by [email protected]
on 14 Jul 2011 at 5:39
from berkeleylm.
Of course, fast is always better :)
However, it seems I have not fully understood the way the library works.
Two questions:
1) As the JavaDocs say that getLogProb() is slow, what is a fast way to get
this information given a phrase?
2) How is this probability computed given the raw counts in the Google web1t
corpus? It seems to me there should be an easy way to just invert the process.
thanks for your help,
Torsten
Original comment by [email protected]
on 15 Jul 2011 at 7:52
from berkeleylm.
1) NgramLanguageModel.getLogProb(List<W>) is "slow" because it has to turn the
List<W> into an int[] first. Note that it is not actually "slow", just slow
relative to the efficient accessors in
ArrayEncodedNgramLanguageModel.getLogProb(int[]) and
ContextEncodedNgramLanguageModel.getLogProb. I have added additional comments
that direct you towards those calls so others are not confused by this.
2) The probability is computed using Stupid Backoff. I have added a call to
StupidBackoffLm that grabs the count, and will be releasing a new version of
the code with this fix shortly.
Original comment by [email protected]
on 15 Jul 2011 at 6:19
- Changed state: Fixed
from berkeleylm.
Related Issues (20)
- ArrayIndexOutOfBoundsException while calling getLogProb HOT 8
- Runtime exception: Hash map is full with 100 keys. Should never happen. HOT 16
- What's the log base of NgramLanguageModel.getLogProb() ? HOT 5
- Can I feed this library raw counts instead of text files, and have it compute the Kneser Ney probabilities for me? HOT 1
- ArrayOutOfBoundsException when reading in a large ARPA file. HOT 7
- Are the log probabilities comparable across language models? HOT 4
- Cannot train unigram model with Kneser-Ney HOT 2
- Unrealistic perplexity HOT 3
- broken link on http://tomato.banatao.berkeley.edu:8080/berkeleylm_binaries/ HOT 1
- StarPos and EndPos for ngram log probability HOT 3
- Getting NAN on last trigram when using google binary HOT 1
- Trying to build a language model on higher-order n-grams. HOT 3
- Frequency Map HOT 1
- Calculating log probability over larger document
- Unknown Values
- Old mvn file
- no start token with LmReaders.readNgramMapFromBinary?
- no license information
- Documentation, usage, etc.
- creating and reading arpa files is 1. locale dependant 2. seems to have problems with multiple tabs in the text 3. seems to have some problem with the lack of newlines HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from berkeleylm.