openIE 5需要下载Berkeley language model, 但是Github上给出的链接是google driver的,下载老是出错,加上文件很大,下载了两天基本都是失败。联系了作者,作者说可以用如下步骤生成。
详细步骤
1. Download the Web1T file and the vocabulary for English from
http://tomato.banatao.berkeley.edu:8080/berkeleylm_binaries/
2. Download the Language Model jar from the link you mentioned.
4. Serialize that object and you will get the 6.4G file that I uploaded.
使用readGoogleLmBinary into a Stupid Backoff Object的java代码:
import edu.berkeley.nlp.lm.io.LmReaders;
public class stupidOff {
public static void main(String []args) {
String file1="languageModel";
// final WordIndexer<W> file2="en.blm Web1T";
String file2="E://eclipse file//LmReaders//src//en.blm Web1T";
String file3="E://eclipse file//LmReaders//src//vocab_cs vocabulary for English";
// edu.berkeley.nlp.lm.io.LmReaders.readGoogleLmBinary(file1, "en.blm Web1T", file3);
// edu.berkeley.nlp.lm.io.LmReaders.readGoogleLmBinary(file1, file2, file3);
edu.berkeley.nlp.lm.io.LmReaders.readGoogleLmBinary(file2, file3);
}
}
文件放置图: