MCPcopy Create free account

hub / github.com/hankcs/HanLP / functions

Functions2,968 in github.com/hankcs/HanLP

Methodforward
(self, x)
hanlp/components/srl/span_rank/layer.py:124
Methodforward
(self, input1, input2)
hanlp/components/srl/span_rank/layer.py:152
Methodforward
(self, x, mask=None, hx=None, dropout=None)
hanlp/components/srl/span_rank/layer.py:205
Methodforward
(self, x, mask=None, hx=None, dropout=None)
hanlp/components/srl/span_rank/layer.py:238
Methodforward
(self, input, masks, initial=None)
hanlp/components/srl/span_rank/layer.py:343
Methodforward
(self, batch, mask)
hanlp/components/srl/span_bio/baffine_tagging.py:70
Methodforward
(self, x: torch.Tensor)
hanlp/components/eos/ngram.py:58
Methodforward
(self, contextualized_embeddings: torch.FloatTensor, batch: Dict[str, torch.Tensor], mask=None)
hanlp/components/mtl/tasks/dep_2nd.py:28
Methodforward
Args: contextualized_embeddings: Hidden states for contextual layer. batch: A dict of a batch. mask: Mas
hanlp/components/mtl/tasks/pos.py:38
Methodforward
(self, contextualized_embeddings: torch.FloatTensor, batch: Dict[str, torch.Tensor], mask=None)
hanlp/components/mtl/tasks/lem.py:26
Methodforward
(self, contextualized_embeddings: torch.FloatTensor, batch: Dict[str, torch.Tensor], mask=None)
hanlp/components/mtl/tasks/ner/tag_ner.py:33
Methodforward
(self, contextualized_embeddings: torch.FloatTensor, batch: Dict[str, torch.Tensor], mask=None)
hanlp/components/mtl/tasks/tok/tag_tok.py:32
Methodforward
(self, input: Tensor, **kwargs)
hanlp/components/mtl/tasks/tok/reg_tok.py:43
Methodforward
(self, tokens: torch.LongTensor)
hanlp/layers/dropout.py:62
Methodforward
(self, x)
hanlp/layers/dropout.py:81
Methodforward
(self, *items)
hanlp/layers/dropout.py:130
Methodforward
(self, x)
hanlp/layers/dropout.py:148
Methodforward
Compute a weighted average of the ``tensors``. The input tensors an be any shape with at least two dimensions, but must all be the same shape
hanlp/layers/scalar_mix.py:86
Methodforward
(self, *inputs, pass_through: List[str] = None, **kwargs)
hanlp/layers/time_distributed.py:31
Methodforward
(self, tokens: torch.Tensor, mask: torch.BoolTensor)
hanlp/layers/cnn_encoder.py:87
Methodforward
(self, inputs: torch.Tensor)
hanlp/layers/feedforward.py:100
Methodforward
(self, ids: torch.LongTensor, lens: torch.LongTensor)
hanlp/layers/embeddings/contextual_string_embedding.py:44
Methodforward
(self, batch: dict, **kwargs)
hanlp/layers/embeddings/word2vec.py:57
Methodforward
(self, batch: dict, mask=None, **kwargs)
hanlp/layers/embeddings/contextual_word_embedding.py:53
Methodforward
(self, batch: dict, **kwargs)
hanlp/layers/embeddings/char_cnn.py:74
Methodforward
(self, batch, mask, **kwargs)
hanlp/layers/embeddings/char_rnn.py:47
Methodforward
(self, batch: dict, **kwargs)
hanlp/layers/embeddings/embedding.py:79
Methodforward
(self, input_ids: torch.LongTensor, attention_mask=None, token_type_ids=None, token_span=None, **kwargs)
hanlp/layers/transformers/encoder.py:97
Methodforward
Input is expected to be of size [bsz x seqlen]. Args: inputs: Tensor: Returns:
hanlp/layers/transformers/relative_transformer.py:62
Methodforward
Args: x: batch_size x max_len x d_model mask: batch_size x max_len Returns:
hanlp/layers/transformers/relative_transformer.py:120
Methodforward
Args: x: batch_size x max_len x hidden_size mask: batch_size x max_len, 为0的地方为pad Returns: batch_size
hanlp/layers/transformers/relative_transformer.py:248
Methodforward
Args: x: batch_size x max_len mask: batch_size x max_len. 有value的地方为1 x: Tensor: mask: Tensor:
hanlp/layers/transformers/relative_transformer.py:295
Methodforward
Compute the conditional log likelihood of a sequence of tags given emission scores. Args: emissions (`~torch.Tensor`): Emission s
hanlp/layers/crf/crf.py:82
Methodfrom_config
(meta: dict, **kwargs)
hanlp/components/lambda_wrapper.py:25
Methodfrom_config
(meta: Union[dict, str], **kwargs)
hanlp/components/pipeline.py:176
Methodfrom_config
Creates an optimizer from its config with WarmUp custom object. Args: config: Returns:
hanlp/optimizers/adamw/optimization.py:139
Methodfrom_config
Args: config: kwargs: config: dict: Returns:
hanlp/common/transform.py:249
Methodfrom_config
Build an object from config. Args: config: A ``dict`` holding parameters for its constructor. It has to contain a `classpath` key,
plugins/hanlp_common/hanlp_common/configurable.py:9
Methodfrom_lists
(cls, all_list)
plugins/hanlp_common/hanlp_common/amr.py:693
Methodfrom_meta
Parameters ---------- meta kwargs Returns ------- KerasComponent
hanlp/common/keras_component.py:471
Methodfrom_prediction
(cls, prediction)
plugins/hanlp_common/hanlp_common/amr.py:724
Methodfrom_pretrained
(cls, pretrained_model_path, additional_tokens: Iterable[str] = None, recategorization
hanlp/components/amr/seq2seq/dataset/tokenization_bart.py:36
Methodfrom_pretrained
(cls, pretrained_model_name_or_path, **kwargs)
hanlp/layers/transformers/pt_imports.py:33
Methodfrom_pretrained
(cls, pretrained_model_name_or_path, use_fast=True, do_basic_tokenize=True)
hanlp/layers/transformers/pt_imports.py:41
Functionfsp_loss
r''' * Takes in two lists of matrics `state_S` and `state_T`. Each list contains two matrices of the shape (*batch_size*, *length*, *hidden_size*)
hanlp/components/distillation/losses.py:194
Functiongenerate_lemma_rule
(sample: dict)
hanlp/components/parsers/ud/util.py:8
Functiongenerate_oracle
(sample: dict)
hanlp/datasets/parsing/amr.py:29
Methodgenerate_prediction_filename
(self, tst_data, save_dir)
hanlp/components/tokenizers/transformer.py:213
Methodgenerate_prediction_filename
(self, tst_data, save_dir)
hanlp/components/ner/transformer_ner.py:114
Functiongenerate_tags_for_subtokens
Create a sequence of x for tokenization task. Each x is an atomic subtoken that will be tagged with BMES or BI tags. Args: sample: D
hanlp/datasets/tokenization/loaders/txt.py:85
Functiongenerate_token_span_tuple
(sample: dict)
hanlp/components/mtl/tasks/tok/reg_tok.py:23
Functiongenerate_words_per_line
(file_path)
hanlp/utils/span_util.py:8
Functiongenerate_words_per_line
(file_path)
hanlp/transform/txt_tf.py:18
Methodgenerator
()
hanlp/common/transform_tf.py:140
Methodgenerator
()
hanlp/transform/conll_tf.py:116
Methodgenerator
()
hanlp/transform/conll_tf.py:581
Methodgenerator_to_callable
(generator: Generator)
hanlp/common/transform_tf.py:238
Methodget_attr_priority
(attr)
plugins/hanlp_common/hanlp_common/amr.py:190
Methodget_config
(self)
hanlp/layers/weight_normalization.py:221
Methodget_config
(self)
hanlp/layers/embeddings/fast_text_tf.py:89
Methodget_config
(self)
hanlp/layers/embeddings/char_cnn_tf.py:48
Methodget_config
(self)
hanlp/layers/embeddings/concat_embedding.py:48
Methodget_config
(self)
hanlp/layers/embeddings/char_rnn_tf.py:54
Methodget_config
(self)
hanlp/layers/embeddings/word2vec_tf.py:161
Methodget_config
(self)
hanlp/layers/embeddings/contextual_string_embedding_tf.py:113
Methodget_config
(self)
hanlp/optimizers/adamw/optimization.py:208
Methodget_config
(self)
hanlp/losses/sparse_categorical_crossentropy.py:44
Methodget_decoder
(self)
hanlp/components/amr/amrbart/model_interface/modeling_bart.py:1289
Methodget_decoder
(self)
hanlp/components/amr/amrbart/model_interface/modeling_bart.py:1727
Functionget_device_of
Returns the device of the tensor. Args: tensor: torch.Tensor: Returns:
hanlp/components/parsers/ud/udify_util.py:357
Methodget_edges
(self)
plugins/hanlp_common/hanlp_common/amr.py:491
Methodget_encoder
(self)
hanlp/components/amr/amrbart/model_interface/modeling_bart.py:1286
Methodget_frame_attributes
(self)
plugins/hanlp_common/hanlp_common/amr.py:260
Methodget_frequency
(self, token)
hanlp/common/vocab.py:432
Methodget_idx
(self, token: str)
hanlp/common/vocab.py:387
Methodget_idx
(self, token: str)
hanlp/common/vocab.py:401
Methodget_idx
(self, token: str)
hanlp/common/vocab.py:446
Methodget_idx_without_add
(self, token: str)
hanlp/common/vocab_tf.py:94
Methodget_input_dim
(self)
hanlp/layers/cnn_encoder.py:81
Methodget_input_dim
(self)
hanlp/layers/feedforward.py:97
Methodget_input_embeddings
(self)
hanlp/components/amr/amrbart/model_interface/modeling_bart.py:729
Methodget_input_embeddings
(self)
hanlp/components/amr/amrbart/model_interface/modeling_bart.py:901
Methodget_input_embeddings
(self)
hanlp/components/amr/amrbart/model_interface/modeling_bart.py:1159
Methodget_input_embeddings
(self)
hanlp/components/amr/amrbart/model_interface/modeling_bart.py:1712
Methodget_list_data
(self, amr, bos=None, eos=None, bert_tokenizer=None, max_tgt_length=None)
plugins/hanlp_common/hanlp_common/amr.py:549
Methodget_loss
(self, arc_scores, rel_scores, arcs, rels, mask, arc_loss, rel_loss)
hanlp/components/parsers/biaffine_parser_tf.py:371
Methodget_loss
(self, arc_scores, rel_scores, arcs, rels, mask, arc_loss, rel_loss)
hanlp/components/parsers/biaffine_parser_tf.py:552
Methodget_name_node_type
(self, node)
plugins/hanlp_common/hanlp_common/amr.py:352
Methodget_name_node_wiki
(self, node)
plugins/hanlp_common/hanlp_common/amr.py:359
Methodget_named_entity_span
(self, index)
plugins/hanlp_common/hanlp_common/amr.py:108
Functionget_optimizers
Modified from https://github.com/huggingface/transformers/blob/7b75aa9fa55bee577e2c7403301ed31103125a35/src/transformers/trainer.py#L232 Setu
hanlp/layers/transformers/utils.py:320
Methodget_output_dim
(self)
hanlp/layers/cnn_encoder.py:84
Methodget_output_dim
(self)
hanlp/layers/feedforward.py:94
Methodget_output_dim
(self)
hanlp/layers/embeddings/fast_text.py:86
Methodget_output_dim
(self)
hanlp/layers/embeddings/contextual_word_embedding.py:70
Methodget_output_dim
(self)
hanlp/layers/embeddings/contextual_word_embedding.py:172
Methodget_output_dim
(self)
hanlp/layers/embeddings/char_cnn.py:80
Methodget_output_dim
(self)
hanlp/layers/embeddings/embedding.py:75
Methodget_output_dim
(self)
hanlp/layers/transformers/relative_transformer.py:328
Methodget_output_embeddings
(self)
hanlp/components/amr/amrbart/model_interface/modeling_bart.py:1306
← previousnext →2,301–2,400 of 2,968, ranked by callers