stanford-nlp

How to iterate through each line of a text file and get the sentiment of those lines using python?

一世执手 提交于 2019-12-13 09:03:02
问题 Currently, I'm working on Sentiment Analysis part. For this I have preferred to use Standford Core NLP library using python. I'm able to get the sentiment for each sentence using the following code : from pycorenlp import StanfordCoreNLP nlp = StanfordCoreNLP('http://localhost:9000') res = nlp.annotate("I love you. I hate him. You are nice. He is dumb", properties={ 'annotators': 'sentiment', 'outputFormat': 'json', 'timeout': 1000, }) for s in res["sentences"]: print("%d: '%s': %s %s" % ( s[

stanford corenlp sentiment training set

陌路散爱 提交于 2019-12-13 08:33:17
问题 I am new to the area of NLP and sentiment analysis in particular. My goal is to train the Stanford CoreNLP sentiment model. I am aware that the sentences provided as training data should be in the following format. (3 (2 (2 The) (2 Rock)) (4 (3 (2 is) (4 (2 destined) (2 (2 (2 (2 (2 to) (2 (2 be) (2 (2 the) (2 (2 21st) (2 (2 (2 Century) (2 's)) (2 (3 new) (2 (2 ``) (2 Conan)))))))) (2 '')) (2 and)) (3 (2 that) (3 (2 he) (3 (2 's) (3 (2 going) (3 (2 to) (4 (3 (2 make) (3 (3 (2 a) (3 splash)) (2

Vector Space Model - query vector [0, 0.707, 0.707] calculated

浪子不回头ぞ 提交于 2019-12-13 07:53:43
问题 I'm reading the book "Introduction to Information Retrieval "(Christopher Manning) and I'm stuck on the chapter 6 when it introduces the query "jealous gossip" for which it indicated that the vector unit associated is [0, 0.707, 0.707] ( https://nlp.stanford.edu/IR-book/html/htmledition/queries-as-vectors-1.html ) considering the terms affect, jealous and gossip. I tried to calculate it by computing the tf idf assuming that: - Tf is equal to 1 for jealous and gossip - Idf is always equal to 0

Installing Stanford Parser's Python interface: error: command 'gcc' failed with exit status 1 rake aborted

﹥>﹥吖頭↗ 提交于 2019-12-13 06:10:32
问题 I'd like to install the stanford parser's python interface. http://projects.csail.mit.edu/spatial/Stanford_Parser When running rake setup to install jpype first, I keep ge In file included from src/native/common/jp_reference.cpp:1:0: src/native/common/include/jpype.h:45:17: schwerwiegender Fehler: jni.h: Datei oder Verzeichnis nicht gefunden Kompilierung beendet. error: command 'gcc' failed with exit status 1 rake aborted! The error message is english-german-mixed. It says: heavy failure: jni

Generating stanford semantic graph with nodes storing lemma

雨燕双飞 提交于 2019-12-13 04:32:33
问题 I am trying to generate a SemanticGraph and use semgrex to find the specific node. I would like to use lemma as one of node attribute in semgrex. I saw a relevant question and answer here: CoreNLP SemanticGraph - search for edges with specific lemmas It is mentioned that Make sure that the nodes are storing lemmas -- see the lemma annotator of CoreNLP (currently available for English, only). I current can use pipeline to generate the desired annotation to generate the semantic graph.

Tensorflow Checkpoint not giving issues while used on another system. Python2/3

帅比萌擦擦* 提交于 2019-12-13 03:56:44
问题 I am working with the repository of Stanford related to Pointer Generated network using Tensorflow. The repository is available here: https://github.com/abisee/pointer-generator I have asked for a demo checkpoint in the issue section of this repository and one of the person name Joy has replied me with the check point of his experiment. You can see it here: https://github.com/abisee/pointer-generator/issues/12#issuecomment-320558080 Now when I am running the checkpoint with the code, I am

Can I get an entityMention from the result of a TokensRegex match in Stanford CoreNLP?

牧云@^-^@ 提交于 2019-12-13 03:36:00
问题 I want to add addresses (and possibly other rules based entities) to an NER pipeline and the Tokens Regex seems like a terribly useful DSL for doing so. Following https://stackoverflow.com/a/42604225, I'm created this rules file: ner = { type: "CLASS", value: "edu.stanford.nlp.ling.CoreAnnotations$NamedEntityTagAnnotation" } { pattern: ([{ner:"NUMBER"}] [{pos:"NN"}|{pos:"NNP"}] /ave(nue)?|st(reet)?|boulevard|blvd|r(oa)?d/), action: Annotate($0, ner, "address") } Here's a scala repl session

Unknown symbol in nltk pos tagging for Arabic

孤人 提交于 2019-12-13 02:59:48
问题 I have used nltk to tokenize some arabic text However, i ended up with some results like (u'an arabic character/word', '``') or (u'an arabic character/word', ':') However, they do not provide the `` or : in the documentation. hence i would like to find out what is this from nltk.toeknize.punkt import PunktWordTokenizer z = "أنا تسلق شجرة" tkn = PunkWordTokenizer sen = tkn.tokenize(z) tokens = nltk.pos_tag(sent) print tokens 回答1: The default NLTK POS tag is trained on English texts and is

Is it possible to get better results for parsing imperative sentences with StanfordNLP?

守給你的承諾、 提交于 2019-12-13 02:56:13
问题 I want to find patterns in sentence structure. Therefore I'm trying to get the parse tree as preprocessing. Until now I used the Stanford CoreNLPParser. Many of my sentences are imperative sentences. After receiving much more clusters as I expected, I reviewed the parse tree and found out that often verbs at the beginning of my imperative sentences were parsed as Noun Phrases (NP). I found the following answer: https://stackoverflow.com/a/35887762/6068675 Since this answer is from 2016 I was

Stanford NLP 3.9.0: Does using CoreEntityMention combine adjacent entity mentions?

流过昼夜 提交于 2019-12-13 02:54:38
问题 I am testing out getting entity mentions the new 3.9.0 way with CoreEntityMention. I do something like: CoreDocument document = new CoreDocument(text); stanfordPipe = createNerPipeline(); stanfordPipe.annotate(document); for (CoreSentence sentence : document.sentences()) { logger.debug("Found sentence {}", sentence); if (sentence.entityMentions() == null) continue; for (CoreEntityMention cem : sentence.entityMentions()) { logger.debug("Found em {}", stringify(cem)); } } When I iterate through