本文整理匯總了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