本文整理汇总了Python中allennlp.data.DatasetReader方法的典型用法代码示例。如果您正苦于以下问题:Python data.DatasetReader方法的具体用法?Python data.DatasetReader怎么用?Python data.DatasetReader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类allennlp.data
的用法示例。
在下文中一共展示了data.DatasetReader方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from allennlp import data [as 别名]
# 或者: from allennlp.data import DatasetReader [as 别名]
def __init__(
self, model: Model, dataset_reader: DatasetReader, language: str = "en_core_web_sm"
) -> None:
super().__init__(model, dataset_reader)
self._tokenizer = SpacyTokenizer(language=language, pos_tags=True)
示例2: __init__
# 需要导入模块: from allennlp import data [as 别名]
# 或者: from allennlp.data import DatasetReader [as 别名]
def __init__(self, model: Model, dataset_reader: DatasetReader) -> None:
super().__init__(model, dataset_reader)
示例3: __init__
# 需要导入模块: from allennlp import data [as 别名]
# 或者: from allennlp.data import DatasetReader [as 别名]
def __init__(self,
model: Model,
dataset_reader: DatasetReader,
output_conllu: bool = False) -> None:
super().__init__(model, dataset_reader)
self._dataset_reader = UniversalDependenciesRawDatasetReader(self._dataset_reader)
self.predictor = UdifyPredictor(model, dataset_reader)
self.output_conllu = output_conllu
示例4: __init__
# 需要导入模块: from allennlp import data [as 别名]
# 或者: from allennlp.data import DatasetReader [as 别名]
def __init__(self, model: Model, dataset_reader: DatasetReader) -> None:
super().__init__(model, dataset_reader)
warnings.warn(
"The 'copynet' predictor has been deprecated in favor of "
"the 'seq2seq' predictor.",
DeprecationWarning,
)
示例5: __init__
# 需要导入模块: from allennlp import data [as 别名]
# 或者: from allennlp.data import DatasetReader [as 别名]
def __init__(self,
model: Model,
dataset_reader: DatasetReader) -> None:
super().__init__(model, dataset_reader)
self.tokenizer = WordTokenizer(word_splitter=SpacyWordSplitter(pos_tags=True))
示例6: __init__
# 需要导入模块: from allennlp import data [as 别名]
# 或者: from allennlp.data import DatasetReader [as 别名]
def __init__(self, model: Model, dataset_reader: DatasetReader) -> None:
super().__init__(model, dataset_reader)
self._entailment_idx = self._model.vocab.get_token_index("entailment", "labels")
self._contradiction_idx = self._model.vocab.get_token_index("contradiction", "labels")
self._neutral_idx = self._model.vocab.get_token_index("neutral", "labels")
示例7: __init__
# 需要导入模块: from allennlp import data [as 别名]
# 或者: from allennlp.data import DatasetReader [as 别名]
def __init__(self,
model: Model,
dataset_reader: DatasetReader,
fix_subwords=True) -> None:
super().__init__(model, dataset_reader)
self._fix_subwords = fix_subwords
示例8: __init__
# 需要导入模块: from allennlp import data [as 别名]
# 或者: from allennlp.data import DatasetReader [as 别名]
def __init__(self,
model: Model,
dataset_reader: DatasetReader,
top_n=3,
border=None,
fix_subwords=True) -> None:
super().__init__(model, dataset_reader)
self._top_n = top_n
self._border = border
self._fix_subwords = fix_subwords