斯坦福NLP +为卢比等新货币提供培训

时间:2017-01-25 04:31:44

标签: stanford-nlp

The online NER demo使用$和百万等条款做得很好。例如: BSES已投资超过72亿美元用于升级和扩充基础设施。印度使用的条款相同: BSES已投资超过7200亿卢比用于升级和扩充基础设施

1 个答案:

答案 0 :(得分:0)

最简单的方法可能是使用基于规则的方法。

以下是我在currency-rules.txt

中添加的示例规则
Rs [0-9]+ crores        MONEY   MISC    1

这是我在你的例句中运行的命令:

java -Xmx8g edu.stanford.nlp.pipeline.StanfordCoreNLP -annotators tokenize,ssplit,pos,lemma,ner,regexner -regexner.mapping currency-rules.txt -file sample-sentence.txt -outputFormat text

能够正确识别短语" Rs 7200 crores"作为金钱。

此外,如果您想处理任何货币符号并将其标准化,您可能需要查看此类:

https://github.com/stanfordnlp/CoreNLP/blob/master/src/edu/stanford/nlp/ie/QuantifiableEntityNormalizer.java

如果您对添加印度货币有任何建议,我可以将它们添加到此课程中。