标签: stanford-nlp

斯坦福NLP工具包解析 - 帮我找到手册

任何人都可以通过发送斯坦福NLP依赖手册的URL来帮助我....

stanford-nlp

1
推荐指数
1
解决办法
635
查看次数

斯坦福解析器 - 用金融工具标记

我有一套财务文件(固定条款存款文件,信用卡文件).我想在这些文件中自动识别和标记金融实体/工具.

例如,如果文件中包含此短语,则"保留以利息偿还的权利,恕不另行通知".我想识别与之相关的财务条款,并用它标记,因为这句话是"可调用的".对于这个短语"允许提前提款",相关的财务条款是"可投放的",所以如果这个短语在文件中,我想用术语"Putable"标记它.

财务条款将来自金融业商业本体论.有没有可能为此目的使用斯坦福解析器?我可以将POS标签用于此目的吗?我可能需要用金融工具培训斯坦福大学的解析器,如果有可能我可以如何培训斯坦福大学的解析器来识别金融工具?

java finance nlp machine-learning stanford-nlp

1
推荐指数
1
解决办法
797
查看次数

Stanford-CoreNLP和Stanford-Parser中的Maven类名冲突

我的(maven)项目依赖于stanford-CoreNLP和stanford-Parser,显然每个依赖的(词汇化)解析器产生不同的输出,它们不相似.

我的问题是如何确定应该从哪个包加载解析器?解析器类在两个包中都有相同的名称: edu.stanford.nlp.parser.lexparser.LexicalizedParser maven自动从stanford-coreNLP包加载类,而我希望它从stanford-Parser加载.

如果你能帮助我提出建议,我将不胜感激.

java dependency-management stanford-nlp maven

1
推荐指数
1
解决办法
162
查看次数

斯坦福核心NLP没有根的解析树

我正在使用Stanford CoreNLP来获取句子的依赖树.我遇到的问题是,对于某些句子,树没有根节点.这可能吗?

这里有一个类似的例子,其中检测到的问题是打印方法(即有一个根,但不知何故它没有被打印).

但是,在我的情况下,句子根本没有根.这是我的测试句子:"(Wendigo是)为什么我们去看电影:通过眼睛,心脏和头脑喂养."

我正在使用以下代码打印依赖项:

SemanticGraph dependencies = sentence.get(CollapsedCCProcessedDependenciesAnnotation.class);
out.println(dependencies.toString("plain"));
Run Code Online (Sandbox Code Playgroud)

这是输出:

nsubj(-RRB--4, Wendigo-2)
cop(-RRB--4, is-3)
advmod(go-7, why-5)
nsubj(go-7, we-6)
advcl(-RRB--4, go-7)
det(cinema-10, the-9)
prep_to(go-7, cinema-10)
aux(fed-14, to-12)
auxpass(fed-14, be-13)
parataxis(go-7, fed-14)
det(eye-17, the-16)
prep_through(fed-14, eye-17)
det(heart-20, the-19)
appos(eye-17, heart-20)
det(mind-23, the-22)
appos(heart-20, mind-23)
Run Code Online (Sandbox Code Playgroud)

尝试手动打印根节点后,使用以下代码:

IndexedWord root = dependencies.getFirstRoot();
out.printf("ROOT(root-0, %s-%d)%n", root.word(), root.index());
Run Code Online (Sandbox Code Playgroud)

我收到以下错误消息:

Exception in thread "main" java.lang.RuntimeException: No roots in graph:
dep                 reln                gov                 
---                 ----                ---                 
Wendigo-2           nsubj               -RRB--4             
is-3                cop                 -RRB--4             
why-5               advmod              go-7                
we-6                nsubj …
Run Code Online (Sandbox Code Playgroud)

dependencies root stanford-nlp

1
推荐指数
1
解决办法
841
查看次数

显示斯坦福NER的置信度

我正在使用斯坦福NER CRFC分类器从新闻文章中提取命名实体,为了实现主动学习,我想知道每个标记实体的类的置信度分数.

显示的例子:

位置(0.20)人(0.10)组织(0.60)MISC(0.10)

这是我从文本中提取命名实体的代码:

AbstractSequenceClassifier<CoreLabel> classifier = CRFClassifier.getClassifierNoExceptions(classifier_path);
String annnotatedText = classifier.classifyWithInlineXML(text);
Run Code Online (Sandbox Code Playgroud)

是否有解决方法来获取值和注释?

java named-entity-recognition stanford-nlp

1
推荐指数
1
解决办法
1600
查看次数

使用Stanford Core NLP的其他语言模型

我想使用荷兰模型进行Core NLP的命名实体识别.

我找到了一个来自OpenNLP的预训练模型,但它似乎与CoreNLP无法互操作.

这是为什么?我们仍然可以将Core NLP与英语,中文和西班牙语等语言一起使用吗?

stanford-nlp

1
推荐指数
1
解决办法
1118
查看次数

使用Stanford CoreNLP进行共指解决

我是Stanford CoreNLP工具包的新手,并尝试将其用于解决新闻文本中的核心问题的项目.为了使用Stanford CoreNLP共同参考系统,我们通常会创建一个管道,它需要标记化,句子分割,词性标注,词形化,命名实体重新定义和解析.例如:

Properties props = new Properties();
props.setProperty("annotators", "tokenize, ssplit, pos, lemma, ner, parse, dcoref");
StanfordCoreNLP pipeline = new StanfordCoreNLP(props);

// read some text in the text variable
String text = "As competition heats up in Spain's crowded bank market, Banco Exterior de Espana is seeking to shed its image of a state-owned bank and move into new activities.";

// create an empty Annotation just with the given text
Annotation document = new Annotation(text);

// run all Annotators on …
Run Code Online (Sandbox Code Playgroud)

java nlp stanford-nlp

1
推荐指数
1
解决办法
1619
查看次数

使用standford nlp的情绪分析不起作用

我正在尝试使用standford nlp来获取文本的情绪:这是我的代码:

import java.util.Properties;

import edu.stanford.nlp.ling.CoreAnnotations;
import edu.stanford.nlp.pipeline.Annotation;
import edu.stanford.nlp.pipeline.StanfordCoreNLP;
import edu.stanford.nlp.rnn.RNNCoreAnnotations;
import edu.stanford.nlp.sentiment.SentimentCoreAnnotations;
import edu.stanford.nlp.trees.Tree;
import edu.stanford.nlp.util.CoreMap;

public class SentimentAnalyzer {

    public static void main(String[] args) {
        findSentiment("");
    }

    public static void findSentiment(String line) {
        line = "I started taking the little pill about 6 years ago.";
        Properties props = new Properties();
        props.setProperty("annotators", "tokenize, ssplit, parse, sentiment");
        StanfordCoreNLP pipeline = new StanfordCoreNLP(props);
        int mainSentiment = 0;
        if (line != null && line.length() > 0) {
            int longest = 0; …
Run Code Online (Sandbox Code Playgroud)

java stanford-nlp sentiment-analysis

1
推荐指数
1
解决办法
1120
查看次数

Stanford NER Tagger在NLTK

我想在Python中导入Stanford Named Entity Recognizer.这已经在NLTK包中构建.但是,我的代码不起作用:

 from nltk.tag.stanford import NERTagger
 Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
 ImportError: cannot import name NERTagger
Run Code Online (Sandbox Code Playgroud)

可能是什么原因?在我阅读的所有文章中,它默认都有效.谢谢.

python nltk stanford-nlp

1
推荐指数
1
解决办法
3869
查看次数

使用java 8在文件中使用两个单词的概率分布

我需要包含两个单词的行数.为此,我编写了以下代码:输入文件包含1000 lines和关于4,000 words,大约需要4个小时.是否有一个库Java可以更快地完成它?我可以使用Appache Lucene或实现此代码Stanford Core NLP以减少运行时间吗?

ArrayList<String> reviews = new ArrayList<String>();
ArrayList<String> terms = new ArrayList<String>();
Map<String,Double> pij = new HashMap<String,Double>();

BufferedReader br = null;
FileReader fr = null;
try 
    {
        fr = new FileReader("src/reviews-preprocessing.txt");
            br = new BufferedReader(fr);
            String line;
            while ((line= br.readLine()) != null) 
            {
            for(String term : line.split(" "))
                {
                    if(!terms.contains(term))
                        terms.add(term);
                }
                reviews.add(line);
            }
        } 
        catch (IOException e) { e.printStackTrace();} 
        finally 
        {
            try 
            {
                if (br …
Run Code Online (Sandbox Code Playgroud)

lucene stanford-nlp java-8 probability-distribution

1
推荐指数
1
解决办法
105
查看次数