简体   繁体   中英

Apache Stanbol sentiment analysis and sentence detection not working

I am using Apache Stanbol. It works for enhancing the text, however when I tried sentiment analysis and sentence detection, it doesn't work.

I tried this code

curl -v -X POST -H "Accept: text/plain" -H "Content-type: text/plain; \
charset=UTF-8" --data "Some text for analysis" \
"http://localhost:8081/enhancer/engine/sentiment-wordclassifier"

But it gives blank { } output, I tried changing the header attributes but no luck.

am I missing something? Do I need to do some configuration first?

I even tried adding analyzer in the enhancer chain but the same blank output, also tried REST API for opennlp-sentence , but it didn't work.

I guess you are sending data to the wrong endpoint... usually calls to the enhancer need to be done to all chains:

http://host/stanbol/enhancer

or to a concrete chain:

http://host/stanbol/enhancer/chain/<name>

The enhancer results couldn't be serialized as plain text, but in any of the RDF serialization supported by Stanbol. So the Accept header would need to be any of those, text/turtle for instance.

Further details at the documentation: http://stanbol.apache.org/docs/trunk/components/enhancer/#RESTful_API

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM