简体   繁体   中英

Can aws comprehend be used in splitting documents to sentences?

I started to try aws comprehend. One thing I noticed is that the sentences in the document will affect the sentiment analysis and entity extraction results especially when mixed sentiment sentences exist or some sentences are not capitalized in the document. So correctly splitting the sentences is an important step. However, I can't find an API in comprehend that splits the document in sentences. Is it because comprehend doesn't have the step? If there is, could someone points out how to obtain the splitting results?

BTW, I tried Stanford coreNLP and Google Language Cloud. They both make mistakes in some cases.

Here is what I did: I added '>>>' as a separator between reviews when I was scraping them, then I used this code:

reviews = all_reviews_as_text.split('>>>')  
responses = []  
for review in reviews: 
    response = comprehend.detect_sentiment(Text=review, LanguageCode="en")
    responses.append(response)

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