-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#355 fixed bug: text_opinion actualy required information that would …
…describe a text part, i.e. ContextID.
- Loading branch information
Showing
3 changed files
with
50 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
from arekit.common.text_opinions.base import TextOpinion | ||
|
||
|
||
class ContextOpinion(TextOpinion): | ||
""" This is a text opnion that is a part of a text piece, dubbed as context. | ||
""" | ||
|
||
def __int__(self, doc_id, text_opinion_id, source_id, target_id, label, context_id): | ||
""" context_id: it might be sentence index or a combination of them in case of a complex cases. | ||
""" | ||
super(ContextOpinion, self).__init__(doc_id=doc_id, | ||
text_opinion_id=text_opinion_id, | ||
source_id=source_id, | ||
target_id=target_id, | ||
label=label) | ||
|
||
self.__context_id = context_id | ||
|
||
@property | ||
def ContextID(self): | ||
return self.__context_id |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters