The data was too large, wasn’t it? Is there a way you can create a subset of it, just enough to make the tests work? If that’s not possible, how large was the data that’s still missing?
About 8G. I am testing with different language models I trained to see which is the best. After that, I will upload my data.
Summary of GSoC with LanguageTool
Author: Ze Dang
Chinese is the most widely spoken language in the word. There are more and more Chinese language learner thanks to the the long history and special culture charm of China. Thus, I have worked to maintain and improve Chinese language in LanguageTool in the past three month.
If you have any difficulty or good idea, please post it here or send an email to me:)
Github repository: https://github.com/hyousi/languagetool
Tokenization data: https://drive.google.com/open?id=1OMBIlXnBAelIAIT4pws85GZj1tt8vFNB
- (Default) Lucene index: https://drive.google.com/open?id=1HDMKnF2iQ8Jndgm0Q6hdbgshTsKiUl64
- BerkeleyLM binary: https://drive.google.com/open?id=14VUocKTK1etqmBb40K1LOtyQ5EeVTbSh
Note: LuceneIndex vs BerkeleyLM
|Memory Usage||as normal||8G|
|Check speed(per sentence)||1s||27ms|
- Lucene index slow down speed because the rule makes many queries for a sentence on the disk.
- BerkeleyLM runs faster but uses much more memory.
- Kenlm is smaller and faster than BerkeleyLM, but it is written by C++. Reference: https://kheafield.com/code/kenlm/benchmark/
- Download codes from my github repo.
mvn install -DskipTestsin root directory.
- Download Tokenization Data. Extract it to
- Choose the format you prefer with Trigram data. Download and extract it to
- Add more rules in
- Make ngram rule check faster. idea:
- Rewrite the rule with other algorithm.
- Implement kenlm in pure java.
- Use JNI to call kenLM native functions.
I’m trying the latest version, but even though it works only with 6GB (which means I’m using BerkeleyLM, right?), it’s still slow. I start a server with this command:
java -Xmx6000m -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8081
Then I run some checks as a warmup. When I then profile with jvisualvm, the result looks like this:
readObjFile sounds to me as if something gets initialized over and over. Can you reproduce this?
Thanks. I will fix it ASAP.
It isn’t initialized over and over. Because
word_trigram.binary is large, it takes much time.
RuleHelper get called for every request. That means it takes several seconds even for short sentences. Can you add some caching there? See
cache in, for example,
ConfusionProbabilityRule for how we do that other parts ot LT.
Done it. You can pull it now. And should I also add cache for
Yes, please. Caching is important so short sentences are checked fast. Users often submit short text.
Fixed it now.