-
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.
#473 related refactoring: renaming classes (generalization)
- Loading branch information
Showing
4 changed files
with
24 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
class BaseTextOpinionsLinkageInstancesProvider(object): | ||
from arekit.common.linkage.base import LinkedDataWrapper | ||
|
||
def iter_instances(self, text_opinion_linkage): | ||
|
||
class BaseLinkedDataInstancesProvider(object): | ||
|
||
def iter_instances(self, linked_data): | ||
raise NotImplementedError() | ||
|
||
@staticmethod | ||
def provide_label(text_opinion_linkage): | ||
return text_opinion_linkage.First.Sentiment | ||
def provide_label(linked_data): | ||
""" Implementation based on the first element of the linkage. | ||
""" | ||
assert(isinstance(linked_data, LinkedDataWrapper)) | ||
return linked_data.First.Sentiment |
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 |
---|---|---|
@@ -1,8 +1,8 @@ | ||
from arekit.common.data.input.providers.instances.base import BaseTextOpinionsLinkageInstancesProvider | ||
from arekit.common.data.input.providers.instances.base import BaseLinkedDataInstancesProvider | ||
|
||
|
||
class SingleInstanceTextOpinionsLinkageProvider(BaseTextOpinionsLinkageInstancesProvider): | ||
class SingleInstanceLinkedDataProvider(BaseLinkedDataInstancesProvider): | ||
|
||
def iter_instances(self, text_opinions_linkage): | ||
yield text_opinions_linkage | ||
def iter_instances(self, linked_data): | ||
yield linked_data | ||
return |
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