-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
large and temp API refactoring by switching to 0.22.1 AREkit version.
- Loading branch information
Showing
45 changed files
with
188 additions
and
785 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
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
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,23 +1,9 @@ | ||
import os | ||
from arekit.contrib.experiment_rusentrel.model_io.tf_networks import RuSentRelExperimentNetworkIOUtils | ||
|
||
|
||
class InferIOUtils(RuSentRelExperimentNetworkIOUtils): | ||
class InferIOUtils(object): | ||
|
||
def __init__(self, output_dir, exp_ctx): | ||
assert(isinstance(output_dir, str)) | ||
super(InferIOUtils, self).__init__(exp_ctx=exp_ctx) | ||
self.__output_dir = output_dir | ||
|
||
def __create_annot_input_target(self, doc_id, data_type): | ||
filename = "annot_input_d{doc_id}_{data_type}.txt".format(doc_id=doc_id, data_type=data_type.name) | ||
return os.path.join(self._get_target_dir(), filename) | ||
|
||
def _get_experiment_sources_dir(self): | ||
return self.__output_dir | ||
|
||
def create_opinion_collection_target(self, doc_id, data_type, check_existance=False): | ||
return self.__create_annot_input_target(doc_id=doc_id, data_type=data_type) | ||
|
||
def create_result_opinion_collection_target(self, doc_id, data_type, epoch_index): | ||
return self.__create_annot_input_target(doc_id=doc_id, data_type=data_type) |
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 @@ | ||
class NerObjectDescriptor: | ||
|
||
def __init__(self, pos, length, obj_type): | ||
self.__pos = pos | ||
self.__len = length | ||
self.__obj_type = obj_type | ||
|
||
@property | ||
def Position(self): | ||
return self.__pos | ||
|
||
@property | ||
def Length(self): | ||
return self.__len | ||
|
||
@property | ||
def ObjectType(self): | ||
return self.__obj_type | ||
|
||
def get_range(self): | ||
return self.__pos, self.__pos + self.__len |
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
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.