Skip to content
Discussion options

You must be logged in to vote

There is no object that 1:1 represents a sentence in spaCy. There is information on where sentences begin, and Span objects that can be used to represent sentences.

...accomplish is to attach the sentiment to the sentences directly...

There are several options for this. One option, as suggested by @jkgenser, is to create Span objects for the sentences and using a Span extension to store the sentiment score for the corresponding sentence. Another one is to use a Doc extension for a dict using sentence start/end indices as keys and the sentiment scores as values.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@benwebs
Comment options

@jkgenser
Comment options

@rmitsch
Comment options

Answer selected by benwebs
@benwebs
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
usage General spaCy usage third-party Third-party packages and services feat / transformer Feature: Transformer
3 participants