Python allennlp.data.DatasetReader() Examples
The following are 11
code examples of allennlp.data.DatasetReader().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
allennlp.data
, or try the search function
.
Example #1
Source File: sentence_tagger.py From allennlp with Apache License 2.0 | 5 votes |
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)
Example #2
Source File: predictor.py From udify with MIT License | 5 votes |
def __init__(self, model: Model, dataset_reader: DatasetReader) -> None: super().__init__(model, dataset_reader)
Example #3
Source File: text_predictor.py From udify with MIT License | 5 votes |
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
Example #4
Source File: copynet.py From nlp-models with MIT License | 5 votes |
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, )
Example #5
Source File: prostruct_prediction.py From propara with Apache License 2.0 | 5 votes |
def __init__(self, model: Model, dataset_reader: DatasetReader) -> None: super().__init__(model, dataset_reader) self.tokenizer = WordTokenizer(word_splitter=SpacyWordSplitter(pos_tags=True))
Example #6
Source File: entailment_pair.py From multee with Apache License 2.0 | 5 votes |
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")
Example #7
Source File: summary_predictor.py From summarus with Apache License 2.0 | 5 votes |
def __init__(self, model: Model, dataset_reader: DatasetReader, fix_subwords=True) -> None: super().__init__(model, dataset_reader) self._fix_subwords = fix_subwords
Example #8
Source File: summary_predictor.py From summarus with Apache License 2.0 | 5 votes |
def __init__(self, model: Model, dataset_reader: DatasetReader) -> None: super().__init__(model, dataset_reader, fix_subwords=False)
Example #9
Source File: summary_predictor.py From summarus with Apache License 2.0 | 5 votes |
def __init__(self, model: Model, dataset_reader: DatasetReader) -> None: super().__init__(model, dataset_reader, fix_subwords=True)
Example #10
Source File: summary_sentences_predictor.py From summarus with Apache License 2.0 | 5 votes |
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
Example #11
Source File: summary_sentences_predictor.py From summarus with Apache License 2.0 | 5 votes |
def __init__(self, model: Model, dataset_reader: DatasetReader, top_n=3, border=None) -> None: super().__init__(model, dataset_reader, top_n, border, fix_subwords=False)