MCPcopy Index your code

hub / github.com/hankcs/HanLP / functions

Functions2,968 in github.com/hankcs/HanLP

↓ 2 callersMethod__init__
The base class for transorfmer based components. If offers methods to build transformer tokenizers , optimizers and models. Args:
hanlp/components/classifiers/transformer_classifier.py:53
↓ 2 callersMethod__init__
(self, encoder: torch.nn.Module, scalar_mixes: torch.nn.ModuleDict,
hanlp/components/mtl/multi_task_learning.py:40
↓ 2 callersMethod__init__
(self)
hanlp/utils/time_util.py:213
↓ 2 callersMethod__init__
(self, n_tokens, is_forward_lm: bool, hidden_size: int,
hanlp/layers/embeddings/contextual_string_embedding.py:29
↓ 2 callersMethod__init__
(self, path: str = None, vocab: VocabTF = None, normalize: bool = False, load_all=True, mask_zero=True,
hanlp/layers/embeddings/word2vec_tf.py:19
↓ 2 callersMethod__init__
(self, num_classes, **kwargs)
hanlp/layers/crf/crf_layer_tf.py:46
↓ 2 callersMethod__init__
Vocabulary base class which converts tokens to indices and vice versa. Args: idx_to_token: id to token mapping. token
hanlp/common/vocab.py:13
↓ 2 callersMethod__init__
(self)
hanlp/losses/sparse_categorical_crossentropy.py:32
↓ 2 callersMethod__init__
(self, max_seq_length=512, truncate_long_sequences=True)
hanlp/transform/transformer_tokenizer.py:15
↓ 2 callersMethod__iter__
(self)
hanlp/common/dataset.py:651
↓ 2 callersMethod_add_headers
(self, request)
plugins/hanlp_restful/hanlp_restful/__init__.py:163
↓ 2 callersMethod_adjust_token
(self, batch, cls_is_bos, sep_is_eos, token_key)
hanlp/components/mtl/tasks/__init__.py:233
↓ 2 callersMethod_apply_grads
(self, accum_grads)
hanlp/components/parsers/biaffine_parser_tf.py:524
↓ 2 callersMethod_build_metrics
(self)
hanlp/components/parsers/biaffine_parser_tf.py:162
↓ 2 callersMethod_close_dataloader
(self, d)
hanlp/components/mtl/multi_task_learning.py:311
↓ 2 callersMethod_conll_rows_to_sentence
(self, conll_rows: List[str])
hanlp/datasets/srl/loaders/ontonotes_loader.py:240
↓ 2 callersMethod_convert_embed
(self)
hanlp/components/taggers/rnn_tagger.py:126
↓ 2 callersMethod_decay_weights_op
(self, var, learning_rate, apply_state)
hanlp/optimizers/adamw/optimization.py:158
↓ 2 callersFunction_find_furthest_new_line
Return -1 if read_buffer does not contain new line otherwise the position of the rightmost newline. Args: read_buffer: bytestring Retu
hanlp/utils/file_read_backwards/buffer_work_space.py:175
↓ 2 callersMethod_find_orphan_relation
(self)
hanlp/transform/conll_tf.py:622
↓ 2 callersMethod_fire_process
(self, dataloader, prefetch)
hanlp/common/dataset.py:583
↓ 2 callersMethod_fire_request
(self, request)
plugins/hanlp_restful/hanlp_restful/__init__.py:149
↓ 2 callersMethod_forward_brnn
(cell, gate, input, masks, initial, drop_masks=None, hidden_drop=None)
hanlp/components/srl/span_rank/highway_variational_lstm.py:66
↓ 2 callersMethod_forward_rnn
(cell, gate, input, masks, initial, drop_masks=None, hidden_drop=None)
hanlp/components/srl/span_rank/highway_variational_lstm.py:54
↓ 2 callersFunction_gen_short_sent
(tokens, start, offset, max_seq_length, token_to_char_offset, char_level)
hanlp/utils/string_util.py:53
↓ 2 callersMethod_get_lr
Retrieves the learning rate with the given state. Args: var_device: var_dtype: apply_state: Returns:
hanlp/optimizers/adamw/optimization.py:172
↓ 2 callersFunction_get_model
(dereify)
hanlp/components/amr/seq2seq/dataset/penman.py:22
↓ 2 callersFunction_get_model
(dereify)
hanlp/components/amr/amrbart/common/penman_interface.py:36
↓ 2 callersFunction_get_model
(dereify)
hanlp/components/amr/amrbart/preprocess/penman_interface.py:36
↓ 2 callersMethod_get_or_add_child
(self, char)
plugins/hanlp_trie/hanlp_trie/trie.py:17
↓ 2 callersFunction_get_ranks
(x: torch.Tensor)
hanlp/metrics/spearman_correlation.py:9
↓ 2 callersMethod_id_to_tags
(self, ids)
hanlp/components/taggers/rnn_tagger.py:185
↓ 2 callersMethod_init_config
(self)
hanlp/components/parsers/biaffine_parser_tf.py:49
↓ 2 callersMethod_init_prefix_mask
(self, input_ids)
hanlp/transform/transformer_tokenizer.py:545
↓ 2 callersMethod_load_lm
(self, filepath)
hanlp/layers/embeddings/contextual_string_embedding_tf.py:42
↓ 2 callersFunction_remove_trailing_new_line
Remove a single instance of new line at the end of l if it exists. Args: l: Returns: : bytestring
hanlp/utils/file_read_backwards/buffer_work_space.py:156
↓ 2 callersFunction_remove_wiki
(graph)
hanlp/components/amr/seq2seq/dataset/penman.py:31
↓ 2 callersFunction_remove_wiki
(graph)
hanlp/components/amr/amrbart/common/penman_interface.py:47
↓ 2 callersFunction_remove_wiki
(graph)
hanlp/components/amr/amrbart/preprocess/penman_interface.py:47
↓ 2 callersFunction_replace_color_offset
(msg: str, color: str, ctrl: str)
hanlp/utils/log_util.py:135
↓ 2 callersFunction_replace_with_separator
(text, separator, regexs)
hanlp/utils/rules.py:11
↓ 2 callersMethod_report
(self, loss, metric: AttachmentScore)
hanlp/components/parsers/biaffine/biaffine_dep.py:484
↓ 2 callersMethod_reshape_tensor
(input_tensor)
hanlp/layers/time_distributed.py:65
↓ 2 callersMethod_run_rnn
(self, texts, model)
hanlp/layers/embeddings/contextual_string_embedding_tf.py:74
↓ 2 callersMethod_shift
类似 -3 -2 -1 0 1 2 -3 -2 -1 0 1 2 -3 -2 -1 0 1 2 转换为 0 1 2 -1 0 1 -2 -1 0 Args:
hanlp/layers/transformers/relative_transformer.py:168
↓ 2 callersMethod_step
(self, optimizer, linear_scheduler)
hanlp/components/srl/span_rank/span_rank.py:148
↓ 2 callersMethod_strip_prefix
(label: str)
hanlp/components/classifiers/fasttext_classifier.py:94
↓ 2 callersMethod_tokenize_encoded_graph
(self, encoded)
hanlp/components/amr/seq2seq/dataset/tokenization_bart.py:265
↓ 2 callersMethod_tokenize_encoded_graph
(self, encoded)
hanlp/components/amr/seq2seq/dataset/tokenization_t5.py:256
↓ 2 callersFunction_update_state
(t0, rs0, t1, rs1, delta, arg_id, role)
hanlp/components/srl/span_rank/inference_utils.py:163
↓ 2 callersMethod_validate
( self, emissions: torch.Tensor, tags: Optional[torch.LongTensor] = None,
hanlp/layers/crf/crf.py:160
↓ 2 callersMethod_y_id_to_str
(self, Y_pred)
hanlp/components/classifiers/transformer_classifier_tf.py:144
↓ 2 callersMethodabstractMeaningRepresentation
Abstract Meaning Representation (AMR) captures “who is doing what to whom” in a sentence. Each sentence is represented as a rooted, directed, acyclic
plugins/hanlp_restful_java/src/main/java/com/hankcs/hanlp/restful/HanLPClient.java:387
↓ 2 callersFunctionadd_secondary_arcs_by_preds
(arc_scores, arc_preds, rel_preds, tree, root_rel_idx=None)
hanlp/components/parsers/parse_alg.py:275
↓ 2 callersFunctionadd_secondary_arcs_by_scores
(arc_scores, rel_scores, tree, root_rel_idx, arc_preds=None)
hanlp/components/parsers/parse_alg.py:265
↓ 2 callersFunctionadjust_root_score
(arc_scores, parse_preds, root_rel_idx, rel_scores=None)
hanlp/components/parsers/parse_alg.py:255
↓ 2 callersFunctionadjust_tokens_for_transformers
Adjust tokens for BERT See https://github.com/DoodleJZ/HPSG-Neural-Parser/blob/master/src_joint/Zparser.py#L1204 Args: sentence:
hanlp/layers/transformers/utils_tf.py:173
↓ 2 callersFunctionany_embedding_in
(embeddings, *cls)
hanlp/layers/embeddings/util_tf.py:69
↓ 2 callersMethodapply_mlps
(self, x)
hanlp/components/parsers/biaffine/biaffine_model.py:200
↓ 2 callersMethodassert_results_valid
(self, text, results, trie)
plugins/hanlp_trie/tests/test_trie.py:10
↓ 2 callersMethodattributes
(self, source=None, relation=None, target=None)
plugins/hanlp_common/hanlp_common/amr.py:331
↓ 2 callersFunctionbatch_make_con_txt_if_necessary
(json_files)
hanlp/datasets/srl/ontonotes5/_utils.py:526
↓ 2 callersFunctionbatch_make_dep_conllx_if_necessary
(con_txt_files, language='en')
hanlp/datasets/srl/ontonotes5/_utils.py:552
↓ 2 callersFunctionbatch_make_pos_tsv_if_necessary
(json_files)
hanlp/datasets/srl/ontonotes5/_utils.py:494
↓ 2 callersMethodbatched_inputs_to_batches
(self, corpus, indices, shuffle)
hanlp/transform/conll_tf.py:392
↓ 2 callersFunctionbatchify
(data, vocabs: VocabDict, unk_rate=0., device=None, squeeze=False, tokenizer: TransformerSequence
hanlp/datasets/parsing/amr.py:83
↓ 2 callersMethodbefore_outputs
(self, data)
hanlp/components/parsers/biaffine/biaffine_dep.py:93
↓ 2 callersFunctionbio_tags_to_spans
Given a sequence corresponding to BIO tags, extracts spans. Spans are inclusive and can be of zero length, representing a single word span.
hanlp/utils/span_util.py:314
↓ 2 callersMethodbuild
(self, input_shape)
hanlp/layers/crf/crf_layer_tf.py:64
↓ 2 callersMethodbuild
(self, logger, **kwargs)
hanlp/common/keras_component.py:223
↓ 2 callersMethodbuild_criterion
Implement this method to build criterion (loss function). Args: **kwargs: The subclass decides the method signature.
hanlp/common/torch_component.py:369
↓ 2 callersMethodbuild_dataloader
(self, data: List[str], shuffle=False, device=None, logger: logging.Logger = None, do
hanlp/layers/embeddings/word2vec.py:186
↓ 2 callersMethodbuild_logger
Build a :class:`logging.Logger`. Args: name: The name of this logger. save_dir: The directory this logger should save
hanlp/common/torch_component.py:301
↓ 2 callersMethodbuild_lookup_table
(self)
hanlp/common/vocab_tf.py:129
↓ 2 callersMethodbuild_metric
Implement this to build metric(s). Args: **kwargs: The subclass decides the method signature.
hanlp/common/torch_component.py:378
↓ 2 callersMethodbuild_model
Build model. Args: training: ``True`` if called during training. **kwargs: ``**self.config``.
hanlp/common/torch_component.py:435
↓ 2 callersMethodbuild_optimizer
(self, optimizer='adam', lr=2e-3, mu=.9, nu=.9, epsilon=1e-12, clip=5.0, decay=.75, de
hanlp/components/parsers/biaffine_parser_tf.py:197
↓ 2 callersMethodbuild_progbar
(self, metrics, training=True)
hanlp/components/parsers/biaffine_parser_tf.py:248
↓ 2 callersMethodbuild_samples
Build samples for this task. Called when this task is the first task. Default behaviour is to take inputs as list of tokens and put t
hanlp/components/mtl/tasks/__init__.py:250
↓ 2 callersMethodbuild_tokenizer
(self, additional_tokens)
hanlp/components/amr/seq2seq/seq2seq_amr_parser.py:99
↓ 2 callersMethodbuild_transform
(self, task: Task)
hanlp/components/mtl/multi_task_learning.py:198
↓ 2 callersMethodbuild_transformer
(self, training, transformer)
hanlp/components/parsers/biaffine_parser_tf.py:402
↓ 2 callersMethodbuild_transformer
(self, training=True)
hanlp/components/classifiers/transformer_classifier.py:117
↓ 2 callersFunctionbuild_word2vec_with_vocab
Build word2vec embedding and a vocab. Args: embed: vocab: The vocabulary from training set. extend_vocab: Unlock vocabula
hanlp/layers/embeddings/util.py:78
↓ 2 callersFunctionchu_liu_edmonds
(parse_probs, length)
hanlp/components/parsers/parse_alg.py:177
↓ 2 callersFunctionchuliu_edmonds
r""" ChuLiu/Edmonds algorithm for non-projective decoding. Some code is borrowed from `tdozat's implementation`_. Descriptions of notatio
hanlp/components/parsers/alg.py:408
↓ 2 callersMethodclose
Closes all opened it s file handler.
hanlp/utils/file_read_backwards/file_read_backwards.py:60
↓ 2 callersFunctioncollapse_enhanced_empty_nodes
(sent: list)
hanlp/components/parsers/conll.py:10
↓ 2 callersMethodcollect_outputs
(self, arc_scores, rel_scores, mask, batch, predictions, order, data, use_pos, build_d
hanlp/components/parsers/biaffine/biaffine_dep.py:126
↓ 2 callersFunctioncolor_format
(msg: str)
hanlp/utils/log_util.py:107
↓ 2 callersMethodcompute_loss
(self, out, y, mask, crf_decoder=None)
hanlp/components/parsers/constituency/crf_constituency_parser.py:168
↓ 2 callersMethodcompute_loss
(self, criterion, logits, target, batch)
hanlp/components/classifiers/transformer_classifier.py:197
↓ 2 callersMethodcompute_loss
(self, criterion, pred, srl, mask)
hanlp/components/srl/span_bio/span_bio.py:343
↓ 2 callersMethodcompute_loss
(self, prediction, batch, criterion)
hanlp/components/eos/ngram.py:150
↓ 2 callersMethodcompute_loss
(self, batch: Dict[str, Any], output: Union[torch.Tensor, Dict[str,
hanlp/components/mtl/multi_task_learning.py:748
↓ 2 callersMethodcompute_mask
(arc_scores_2nd, batch, mask_1st)
hanlp/components/parsers/biaffine/biaffine_2nd_dep.py:136
↓ 2 callersFunctioncompute_smatch
(pred, gold)
hanlp/components/amr/seq2seq/evaluation.py:15
↓ 2 callersMethodconnect
(self, to, rel)
hanlp/datasets/qa/hotpotqa.py:121
↓ 2 callersMethodconvert
(self, token)
hanlp/common/transform.py:520
↓ 2 callersMethodconvert_char
(c)
hanlp/utils/lang/zh/char_table.py:17
← previousnext →301–400 of 2,968, ranked by callers