MCPcopy Create free account

hub / github.com/hankcs/HanLP / functions

Functions2,968 in github.com/hankcs/HanLP

Method__init__
(self, src: str)
hanlp/layers/embeddings/contextual_string_embedding.py:137
Method__init__
(self, field, path, trainable=False)
hanlp/layers/embeddings/contextual_string_embedding.py:175
Method__init__
A word2vec style embedding module which maps a token to its embedding through looking up a pre-defined table. Args: field: The fi
hanlp/layers/embeddings/word2vec.py:28
Method__init__
Toy example of Word2VecEmbedding. It simply returns the embedding of a given word Args: **kwargs:
hanlp/layers/embeddings/word2vec.py:177
Method__init__
(self, field, words: dict)
hanlp/layers/embeddings/word2vec.py:305
Method__init__
(self, embed: str, field='char', trainable=False)
hanlp/layers/embeddings/word2vec.py:329
Method__init__
(self, filepath: str, padding=PAD, name=None, **kwargs)
hanlp/layers/embeddings/fast_text_tf.py:20
Method__init__
(self, word_vocab: VocabTF, char_vocab: VocabTF, char_embedding=100, kernel_
hanlp/layers/embeddings/char_cnn_tf.py:14
Method__init__
(self, *embeddings, trainable=True, name=None, dtype=None, dynamic=False, **kwargs)
hanlp/layers/embeddings/concat_embedding.py:11
Method__init__
A contextualized word embedding module. Args: field: The field to work on. Usually some token fields. transformer: A
hanlp/layers/embeddings/contextual_word_embedding.py:18
Method__init__
(self, word_vocab: VocabTF, char_vocab: VocabTF, char_embedding=100, char_rn
hanlp/layers/embeddings/char_rnn_tf.py:12
Method__init__
Args: field: The character field in samples this encoder will work on. embed: An ``Embedding`` object or the feature
hanlp/layers/embeddings/char_cnn.py:85
Method__init__
Character level RNN embedding module builder. Args: field: The field in samples this encoder will work on. embed: An
hanlp/layers/embeddings/char_rnn.py:73
Method__init__
A ``nn.ModuleList`` to bundle several embeddings modules. Args: *modules: Embedding layers. dropout: Dropout applied
hanlp/layers/embeddings/embedding.py:59
Method__init__
An embedding builder to bundle several embedding builders. Args: *embeddings_: A list of embedding builders. embeddin
hanlp/layers/embeddings/embedding.py:94
Method__init__
(self, filepath: str = None, vocab: VocabTF = None, expand_vocab=True, lowercase=True, input_
hanlp/layers/embeddings/word2vec_tf.py:114
Method__init__
(self, filepath: str = None, vocab: VocabTF = None, expand_vocab=True, lowercase=False, input_dim=None,
hanlp/layers/embeddings/word2vec_tf.py:175
Method__init__
(self, forward_model_path=None, backward_model_path=None, max_word_len=10, trainable=False, n
hanlp/layers/embeddings/contextual_string_embedding_tf.py:18
Method__init__
A pre-trained transformer encoder. Args: transformer: A ``PreTrainedModel`` or an identifier of a ``PreTrainedModel``.
hanlp/layers/transformers/encoder.py:19
Method__init__
(self, embedding_dim, padding_idx, init_size=1024)
hanlp/layers/transformers/relative_transformer.py:24
Method__init__
Args: in_features: num_heads: dropout: r_w_bias: n_head x head_dim or None r_r_bi
hanlp/layers/transformers/relative_transformer.py:91
Method__init__
(self, in_features, num_heads=4, feedforward_dim=256,
hanlp/layers/transformers/relative_transformer.py:222
Method__init__
(self, in_features, num_layers=2, num_heads=4,
hanlp/layers/transformers/relative_transformer.py:315
Method__init__
Initialize the CrfDecodeForwardRnnCell. Args: transition_params: A [num_tags, num_tags] matrix of binary potentials. Th
hanlp/layers/crf/crf_tf.py:369
Method__init__
(self, num_tags: int, batch_first: bool = True)
hanlp/layers/crf/crf.py:57
Method__init__
(self, crf: CRF, dtype)
hanlp/layers/crf/crf_layer_tf.py:133
Method__init__
(self, model: tf.keras.Model, num_classes=None, *args, **kwargs)
hanlp/layers/crf/crf_layer_tf.py:154
Method__init__
(self, learning_rate=0.001, beta_1=0.9, beta_2=0.999,
hanlp/optimizers/adamw/optimization.py:121
Method__init__
An object which can be transformed with a list of functions. It is the final result of an object being passed through a list of functions, whi
hanlp/common/dataset.py:31
Method__init__
A :class:`~torch.utils.data.Dataset` which can be applied with a list of transform functions. Args: data: The local or remote pat
hanlp/common/dataset.py:111
Method__init__
(self, dataset, batch_size=32, shuffle=False, sampler=None, batch_sampler=None, num_workers=N
hanlp/common/dataset.py:319
Method__init__
A dataloader commonly used for NLP tasks. It offers the following convenience. - Bachify each field of samples into a :class:`~torch.Tensor`
hanlp/common/dataset.py:356
Method__init__
(self, dataloader: torch.utils.data.DataLoader, filename=None)
hanlp/common/dataset.py:515
Method__init__
A dataloader wrapper which speeds up bachifying using multi-processing. It works best for dataloaders of which the bachify takes very long ti
hanlp/common/dataset.py:553
Method__init__
A bucketing based sampler which groups samples into buckets then creates batches from each bucket. Args: buckets: A dict of which
hanlp/common/dataset.py:624
Method__init__
A bucket sampler which groups samples using KMeans on their lengths. Args: lengths: Lengths of each sample, usually measured by n
hanlp/common/dataset.py:665
Method__init__
A sampler which sorts samples according to their lengths. It takes a continuous chunk of sorted samples to make a batch. The effective batch s
hanlp/common/dataset.py:686
Method__init__
Builds a :class:`~hanlp.common.dataset.SortingSampler`. Args: batch_max_tokens: Maximum tokens per batch. use_effecti
hanlp/common/dataset.py:776
Method__init__
Builds a :class:`~hanlp.common.dataset.KMeansSampler`. Args: batch_max_tokens: Maximum tokens per batch. batch_size:
hanlp/common/dataset.py:798
Method__init__
(self, vocab: Vocab = None)
hanlp/common/transform.py:21
Method__init__
(self, src, vocab: Vocab, dst=None)
hanlp/common/transform.py:45
Method__init__
(self, *fields)
hanlp/common/transform.py:69
Method__init__
A dict holding :class:`hanlp.common.vocab.Vocab` instances. When used as a transform, it transforms the field corresponding to each :class:`ha
hanlp/common/transform.py:101
Method__init__
(self, src: str, dst: str = None)
hanlp/common/transform.py:231
Method__init__
(self, output_dim: int, src: str, dst: str)
hanlp/common/transform.py:275
Method__init__
(self, src, dst)
hanlp/common/transform.py:288
Method__init__
(self, *keys)
hanlp/common/transform.py:298
Method__init__
(self, *transforms)
hanlp/common/transform.py:321
Method__init__
(self, src, dst=None)
hanlp/common/transform.py:350
Method__init__
(self, src: str, dst: str = None, eos=EOS)
hanlp/common/transform.py:402
Method__init__
(self, src, dst=None)
hanlp/common/transform.py:427
Method__init__
(self, src: str, dst: str = None)
hanlp/common/transform.py:454
Method__init__
(self, src: str, dst: str = None, delta=0)
hanlp/common/transform.py:469
Method__init__
(self, field='tag')
hanlp/common/transform.py:481
Method__init__
(self, mapper: Union[str, dict], src: str, dst: str = None)
hanlp/common/transform.py:497
Method__init__
Mask out all punctuations (set mask of punctuations to False) Args: src: dst: Returns:
hanlp/common/transform.py:525
Method__init__
This base class helps sub-classes to capture their arguments passed to ``__init__``, and also their types so that they can be deserialized fro
hanlp/common/structure.py:13
Method__init__
A history of training context. It records how many steps have passed and provides methods to decide whether an update should be performed, an
hanlp/common/structure.py:38
Method__init__
(self, config: SerializableDict = None, map_x=True, map_y=True, **kwargs)
hanlp/common/transform_tf.py:18
Method__init__
(self, idx_to_token: List[str] = None, token_to_idx: Dict = None, mutable=True, pad_token=PAD,
hanlp/common/vocab_tf.py:13
Method__init__
(self, counter: Counter = None, min_occur_cnt=0, pad_token=PAD, unk_token=UNK, specials=None)
hanlp/common/vocab.py:409
Method__init__
(self, idx_to_token: List[str] = None, token_to_idx: Dict = None, mutable=True, pad_token=PAD,
hanlp/common/vocab.py:441
Method__init__
The base class for all components using PyTorch as backend. It provides common workflows of building vocabs, datasets, dataloaders and models.
hanlp/common/torch_component.py:30
Method__init__
(self, transform: Transform)
hanlp/common/keras_component.py:34
Method__init__
(self, data: Union[str, List], transform: Union[Callable, List] = None, cache=None, generate_
hanlp/datasets/tokenization/loaders/chunking_dataset.py:14
Method__init__
A dataset for tagging tokenization tasks. Args: data: The local or remote path to a dataset, or a list of samples where each samp
hanlp/datasets/tokenization/loaders/txt.py:13
Method__init__
(self, data: Union[str, List], transform: Union[Callable, List] = None,
hanlp/datasets/tokenization/loaders/multi_criteria_cws/mcws_dataset.py:12
Method__init__
A dataset for ``.jsonlines`` format NER corpora. Args: data: The local or remote path to a dataset, or a list of samples where ea
hanlp/datasets/ner/loaders/json_ner.py:17
Method__init__
Args: data: The local or remote path to a dataset, or a list of samples where each sample is a dict. transform: Pred
hanlp/datasets/ner/loaders/tsv.py:13
Method__init__
(self, dst='graph')
hanlp/datasets/qa/hotpotqa.py:27
Method__init__
(self, data: str, batch_size, seq_len, tok
hanlp/datasets/lm/loaders/lm_dataset.py:18
Method__init__
(self, data: Union[str, List], sent_a_col, sent_b_col,
hanlp/datasets/sts/stsb.py:15
Method__init__
General class for CoNLL style dependency parsing datasets. Args: data: The local or remote path to a dataset, or a list of sample
hanlp/datasets/parsing/loaders/conll_dataset.py:14
Method__init__
(self)
hanlp/datasets/srl/ontonotes5/_utils.py:33
Method__init__
(self, src: str, mapper: Union[str, dict] = None, dst: str = None)
hanlp/datasets/srl/ontonotes5/_utils.py:652
Method__init__
( self, document_id: str, sentence_id: int, words: List[str], pos_tags
hanlp/datasets/srl/loaders/ontonotes_loader.py:55
Method__init__
(self, src: str, dst: str = None, max_span_width=None)
hanlp/datasets/srl/loaders/conll2012.py:195
Method__init__
Dataset for sentence boundary detection (eos). Args: data: The local or remote path to a dataset, or a list of samples where each
hanlp/datasets/eos/eos.py:16
Method__init__
(self, data: Union[str, List], transform: Union[Callable, List] = None, cache=None, max_span_
hanlp/datasets/coref/loaders/conll12coref.py:53
Method__init__
(self)
hanlp/losses/sparse_categorical_crossentropy.py:12
Method__init__
(self, mask_value=0)
hanlp/losses/sparse_categorical_crossentropy.py:50
Method__init__
(self, src: str = 'token', dst: str = None, add_prefix_space=True)
hanlp/transform/prepend_space.py:7
Method__init__
(self, config: SerializableDict = None, map_x=True, map_y=True, lower=True, n_buckets=32, min
hanlp/transform/conll_tf.py:170
Method__init__
(self, config: SerializableDict = None, map_x=True, map_y=True, lower=True, n_buckets=32, min
hanlp/transform/conll_tf.py:308
Method__init__
(self, config: SerializableDict = None, map_x=True, map_y=True, lower=True, n_buckets=32, min_freq=2,
hanlp/transform/conll_tf.py:612
Method__init__
(self, config: SerializableDict = None, map_x=True, map_y=True, lower=False, **kwargs)
hanlp/transform/tacred_tf.py:31
Method__init__
(self, config: SerializableDict = None, map_x=True, map_y=True, use_char=False, **kwargs)
hanlp/transform/tsv_tf.py:79
Method__init__
(self, config: SerializableDict = None, map_x=False, map_y=True, x_columns=None, y_column=-1,
hanlp/transform/table_tf.py:18
Method__init__
(self, tokenizer: Union[PreTrainedTokenizer, str], text_a_key: str,
hanlp/transform/transformer_tokenizer.py:44
Method__init__
A transformer tokenizer for token-level tasks. It honors the boundary of tokens and tokenize each token into several subtokens then merge them
hanlp/transform/transformer_tokenizer.py:84
Method__init__
(self, config: SerializableDict = None, map_x=False, map_y=True, x_columns=(3, 4), y_column=0
hanlp/transform/glue_tf.py:15
Method__init__
(self, forward=True, seq_len=10, tokenizer='char',
hanlp/transform/text_tf.py:18
Method__init__
(self, i_need_this='yes')
tests/test_config_tracker.py:7
Method__init__
CoNLL-U format template, see https://universaldependencies.org/format.html Args: id (Union[int, str]): Token cou
plugins/hanlp_common/hanlp_common/conll.py:88
Method__init__
A list of :class:`~hanlp_common.conll.CoNLLWord` or :class:`~hanlp_common.conll.CoNLLUWord`. It is a sub-class of :class:`list` and i
plugins/hanlp_common/hanlp_common/conll.py:181
Method__init__
(self, identifier, attributes=None, copy_of=None)
plugins/hanlp_common/hanlp_common/amr.py:179
Method__init__
(self, penman_graph)
plugins/hanlp_common/hanlp_common/amr.py:283
Method__init__
(self, sentence, pad_token=DEFAULT_PADDING_TOKEN, unk_token=DEFAULT_OOV_TOKEN)
plugins/hanlp_common/hanlp_common/amr.py:824
Method__init__
(self, graph, nodes)
plugins/hanlp_common/hanlp_common/amr.py:879
Method__init__
r"""A dict structure holding parsed annotations. A document is a subclass of ``dict`` and it supports every interface of ``dict``\. Additional
plugins/hanlp_common/hanlp_common/document.py:18
← previousnext →1,501–1,600 of 2,968, ranked by callers