我使用斯坦福解析器的命令行:斯坦福解析器的處理時間和存儲器消耗
java -mx1500m -cp stanford-parser.jar;stanford-parser-models.jar edu.stanford.nlp.parser.lexparser.LexicalizedParser -outputFormat "penn" edu/stanford/nlp/models/lexparser/englishPCFG.ser.gz {file}
當我在單個句子運行命令與27個即,Java進程正在消耗的100MB內存和解析需要1.5秒。 當我用148個單詞在單個句子上運行命令時,Java進程佔用1.5GB的內存,解析需要1.5分鐘。
我正在使用的機器是Windows 7與英特爾i5 2.53GH。
這些加工時間是否合理? 解析器是否有任何官方性能基準?
(1)給出27個單詞的1.5秒,這聽起來很合理。你會期望可能的解析增加更多,每句更多的話。問題是你爲什麼用148個單詞解析一個句子?自然語言處理可能不是一個很自然的句子。 (2)沒有人喜歡對NLP工具進行基準測試,它體積龐大,除非您執行一些分佈式計算技巧,否則不會是實時的。 – alvas
同意@ 2er0:148可能是一個太長的句子。你能給我們判刑嗎? – Renaud
謝謝,@ 2er0和Renaud。 我想你回答了我的問題。我只是想驗證1.5秒到27個字的句子是否合理,並且我沒有做出完全錯誤的事情。 我同意148個單詞的句子是不合理的。 我解析這麼長的句子的原因是因爲我有一個可以接收任何輸入的系統。 當句子最後沒有用點打斷時,NLP引擎不能正確地分割它們 - 有時候我會得到如此長的句子。 –