cindyxiaoxiaoli

cindyxiaoxiaoli / SentenceSplitterByContrastiveConjunctions / 0.2.0

README.md

Overview

Splits a string into sentences by contrastive conjunctions like: "however, except, with the exception of, but". Particularly useful for aspect level sentiment analysis where a sentence itself may contain different sentiments against different aspects.

Takes a string as input and return the split sentences as an array of string.

Examples

Example 1

Input:

"I love the product quality at the store but the customer service was lacking."

Output:

​['I love the product quality at the store ', 'but the customer service was lacking.']

Example 2

Note how the sentence is kept whole when but did not mean a twist in the sentence.

Input:

"I would like not only the best products but also the best service."

Output:

​['I would like not only the best products but also the best service.']