MCPcopy Index your code

hub / github.com/explosion/spacy-transformers / functions

Functions214 in github.com/explosion/spacy-transformers

Functioncreate_TransformerModel_v2
( name: str, get_spans: Callable, tokenizer_config: dict = {}, transformer_config: dict = {},
spacy_transformers/architectures.py:190
Functioncreate_TransformerModel_v3
Pretrained transformer model that can be finetuned for downstream tasks. name (str): Name of the pretrained Huggingface model to use. get_spa
spacy_transformers/architectures.py:201
Functioncustom_annotation_setter
(docs, trf_data)
spacy_transformers/tests/test_pipeline_component.py:92
Functiondeserialize_transformer_data
(obj, chain=None)
spacy_transformers/data_classes.py:238
Methoddoc_data
The outputs, split per spaCy Doc object.
spacy_transformers/data_classes.py:301
Functiondocs
(nlp)
spacy_transformers/tests/test_model_wrapper.py:22
Functiondocs
(vocab)
spacy_transformers/tests/test_pipeline_component.py:30
Methodempty
(cls)
spacy_transformers/data_classes.py:166
Methodempty
(cls, nr_docs)
spacy_transformers/data_classes.py:274
Functionforward
(model: TransformerListener, docs, is_train)
spacy_transformers/layers/listener.py:60
Functionforward
(model: Model, trf_datas: List[TransformerData], is_train: bool)
spacy_transformers/layers/trfs2arrays.py:24
Functionforward
(model, trf_full, is_train)
spacy_transformers/layers/split_trf.py:10
Functionforward
( model: TransformerModel, docs: List[Doc], is_train: bool )
spacy_transformers/layers/transformer_model.py:172
Methodfrom_bytes
(self, byte_string: bytes)
spacy_transformers/data_classes.py:224
Functionget_custom_sent_spans
(docs)
spacy_transformers/tests/test_spanners.py:36
Functionget_doc_spans
(docs: Iterable[Doc])
spacy_transformers/span_getters.py:56
Methodget_loss
A noop function, for compatibility with the Pipe API. See the `update` method for an explanation of the loss mechanics of the component.
spacy_transformers/pipeline_component.py:329
Functionget_strided_spans
( docs: Iterable[Doc], window: int, stride: int )
spacy_transformers/span_getters.py:10
Functioninit
(model: TransformerModel, X=None, Y=None)
spacy_transformers/layers/transformer_model.py:129
Functioninit
(model: ClassificationTransformerModel, X=None, Y=None)
spacy_transformers/tests/test_model_sequence_classification.py:95
Methodlisteners
RETURNS (List[TransformerListener]): The listener models listening to this component. Usually internals.
spacy_transformers/pipeline_component.py:129
Methodlistening_components
RETURNS (List[str]): The downstream components listening to this component. Usually internals.
spacy_transformers/pipeline_component.py:136
Methodload_model
(p)
spacy_transformers/pipeline_component.py:386
Functionmake_transformer
Construct a Transformer component, which lets you plug a model from the Huggingface transformers library into spaCy so you can use it in your
spacy_transformers/pipeline_component.py:53
Functionmask_from_end
(shape, max_length)
spacy_transformers/tests/test_truncation.py:69
Functionmax_length
()
spacy_transformers/tests/test_truncation.py:64
Functionname
(request)
spacy_transformers/tests/test_model_wrapper.py:28
Functionnull_annotation_setter
Set no additional annotations on the Doc objects.
spacy_transformers/annotation_setters.py:8
Functionoutput_attentions
(request)
spacy_transformers/tests/test_model_wrapper.py:33
Functionoutput_hidden_states
(request)
spacy_transformers/tests/test_model_wrapper.py:38
Functionparse_data
(nlp, index)
spacy_transformers/tests/test_configs.py:59
Functionread_tagger_data
()
spacy_transformers/tests/test_configs.py:58
Methodremove_listener
Remove a listener for a downstream component. Usually internals.
spacy_transformers/pipeline_component.py:150
Functionreplace_listener
(model)
spacy_transformers/layers/_util.py:5
Functionreplace_listener_cfg
(tok2vec_model_cfg, listener_model_cfg)
spacy_transformers/layers/_util.py:9
Functionseq_lengths
(sequences)
spacy_transformers/tests/test_truncation.py:28
Functionsequences
()
spacy_transformers/tests/test_truncation.py:10
Functionserialize_transformer_data
(obj, chain=None)
spacy_transformers/data_classes.py:231
Functionset_logger
Add a logger that will log memory usage to the given file. Used to debug OOM errors.
spacy_transformers/layers/transformer_model.py:107
Functionset_pytorch_transformer
(model, hf_model: HFObjects)
spacy_transformers/layers/transformer_model.py:118
Functionshape
(sequences)
spacy_transformers/tests/test_truncation.py:21
Methodtensors
(self)
spacy_transformers/data_classes.py:191
Methodtensors
(self)
spacy_transformers/data_classes.py:290
Functiontest_alignments_match
(words1, words2)
spacy_transformers/tests/test_alignment.py:45
Functiontest_apply_alignment
(nested_align, X_cols)
spacy_transformers/tests/test_alignment.py:72
Functiontest_deprecation_warnings
()
spacy_transformers/tests/test_deprecations.py:6
Functiontest_empty_doc
Test that an empty document gets processed correctly
spacy_transformers/tests/regression/test_spacy_issue7029.py:41
Functiontest_frozen_listener
()
spacy_transformers/tests/test_pipeline_component.py:449
Functiontest_get_custom_spans
()
spacy_transformers/tests/test_spanners.py:34
Functiontest_get_sent_spans
()
spacy_transformers/tests/test_spanners.py:21
Functiontest_get_strided_spans
(window, stride, docs, result)
spacy_transformers/tests/test_spanners.py:15
Functiontest_init
(component)
spacy_transformers/tests/test_pipeline_component.py:58
Functiontest_init_nlp
(config_string)
spacy_transformers/tests/test_configs.py:56
Functiontest_initialized_inline_transformer_pipeline_todisk
()
spacy_transformers/tests/test_serialize.py:285
Functiontest_initialized_inline_transformer_tobytes
()
spacy_transformers/tests/test_serialize.py:217
Functiontest_initialized_inline_transformer_todisk
()
spacy_transformers/tests/test_serialize.py:246
Functiontest_initialized_transformer_tobytes
()
spacy_transformers/tests/test_serialize.py:66
Functiontest_initialized_transformer_todisk
()
spacy_transformers/tests/test_serialize.py:79
Functiontest_inline_transformer_pipeline_tobytes
()
spacy_transformers/tests/test_serialize.py:261
Functiontest_inline_transformer_pipeline_todisk
()
spacy_transformers/tests/test_serialize.py:275
Functiontest_inline_transformer_tobytes
()
spacy_transformers/tests/test_serialize.py:206
Functiontest_inline_transformer_todisk
()
spacy_transformers/tests/test_serialize.py:232
Functiontest_listeners
(component, docs)
spacy_transformers/tests/test_pipeline_component.py:104
Functiontest_model_for_sequence_classification
()
spacy_transformers/tests/test_model_sequence_classification.py:26
Functiontest_model_init
(name, trf_model)
spacy_transformers/tests/test_model_wrapper.py:75
Functiontest_model_predict
(nlp, docs, trf_model)
spacy_transformers/tests/test_model_wrapper.py:83
Functiontest_multiprocessing
(simple_nlp, texts)
spacy_transformers/tests/test_pipeline_component.py:438
Functiontest_no_update_listener_in_predict
()
spacy_transformers/tests/test_pipeline_component.py:481
Functiontest_offset_alignment
(words, offset_mapping, alignment)
spacy_transformers/tests/test_alignment.py:103
Functiontest_predict
(component, docs)
spacy_transformers/tests/test_pipeline_component.py:66
Functiontest_replace_listeners
()
spacy_transformers/tests/test_pipeline_component.py:338
Functiontest_replace_listeners_invalid
()
spacy_transformers/tests/test_pipeline_component.py:408
Functiontest_serialize_transformer_data
()
spacy_transformers/tests/test_serialize.py:26
Functiontest_set_annotations
(component, docs)
spacy_transformers/tests/test_pipeline_component.py:82
Functiontest_set_extra_annotations
(component, docs)
spacy_transformers/tests/test_pipeline_component.py:89
Functiontest_source_replace_listeners
Test that a pipeline with a transformer+tagger+senter and some replaced listeners runs and trains properly
spacy_transformers/tests/test_pipeline_component.py:502
Functiontest_textcatcnn
()
spacy_transformers/tests/test_textcatcnn.py:47
Functiontest_transformer_pipeline_empty
Test that the pipeline doesn't fail with empty input
spacy_transformers/tests/test_pipeline_component.py:287
Functiontest_transformer_pipeline_long_token
Test that a simple pipeline does not raise an error on texts that exceeds the model max length. We should truncate instead.
spacy_transformers/tests/test_pipeline_component.py:125
Functiontest_transformer_pipeline_simple
Test that a simple pipeline with just a transformer at least runs
spacy_transformers/tests/test_pipeline_component.py:119
Functiontest_transformer_pipeline_tagger_internal
Test that a tagger with internal transformer runs and trains properly
spacy_transformers/tests/test_tok2vectransformer.py:46
Functiontest_transformer_pipeline_tagger_senter_listener
Test that a pipeline with just a transformer+tagger+senter runs and trains properly
spacy_transformers/tests/test_pipeline_component.py:182
Functiontest_transformer_pipeline_textcat
Test that a pipeline with just a transformer+textcat runs and trains properly. This used to throw an error because of shape inference issues -
spacy_transformers/tests/regression/test_spacy_issue6401.py:42
Functiontest_transformer_pipeline_tobytes
()
spacy_transformers/tests/test_serialize.py:105
Functiontest_transformer_pipeline_todisk
()
spacy_transformers/tests/test_serialize.py:118
Functiontest_transformer_pipeline_todisk_before_initialize
()
spacy_transformers/tests/test_serialize.py:164
Functiontest_transformer_pipeline_todisk_settings
()
spacy_transformers/tests/test_serialize.py:128
Functiontest_transformer_sentencepiece_IO
Test that a transformer using sentencepiece trains + IO goes OK
spacy_transformers/tests/test_pipeline_component.py:238
Functiontest_transformer_tobytes
()
spacy_transformers/tests/test_serialize.py:56
Functiontest_truncate_alignment_from_end
(sequences, max_length, align, mask_from_end)
spacy_transformers/tests/test_truncation.py:88
Functiontest_truncate_wordpieces
(wordpieces, max_length, mask_from_end)
spacy_transformers/tests/test_truncation.py:78
Functiontest_wordpieces_IO
(wordpieces)
spacy_transformers/tests/test_data_classes.py:21
Functiontexts
()
spacy_transformers/tests/test_pipeline_component.py:428
Methodto_bytes
(self)
spacy_transformers/data_classes.py:221
Methodtokenizer
(self)
spacy_transformers/layers/transformer_model.py:74
Methodtokenizer
(self)
spacy_transformers/tests/test_model_sequence_classification.py:63
Methodtokenizer
(self)
spacy_transformers/tests/util.py:166
Methodtokenizer_config
(self)
spacy_transformers/tests/util.py:174
Methodtokens
Deprecated. A dict with the wordpiece token data.
spacy_transformers/data_classes.py:195
Methodtokens
Deprecated. Dict formatted version of the self.wordpieces data, with values converted to PyTorch tensors.
spacy_transformers/data_classes.py:294
← previousnext →101–200 of 214, ranked by callers