MCPcopy Index your code

hub / github.com/hankcs/HanLP / functions

Functions2,968 in github.com/hankcs/HanLP

↓ 6 callersFunction_calc_f1
(total_gold, total_predicted, total_matched, message=None)
hanlp/components/srl/span_rank/srl_eval_utils.py:95
↓ 6 callersMethod_tok_bpe
(self, token, add_space=True)
hanlp/components/amr/seq2seq/dataset/tokenization_t5.py:96
↓ 6 callersMethodadd_edge
(edge)
hanlp/components/amr/seq2seq/dataset/linearization.py:346
↓ 6 callersMethodcstr
(self, idx=None, level=0)
hanlp/metrics/mtl.py:25
↓ 6 callersMethoddecode
Find the most likely tag sequence using Viterbi algorithm. Args: emissions (`~torch.Tensor`): Emission score tensor of size
hanlp/layers/crf/crf.py:136
↓ 6 callersMethodfrom_pretrained
(cls, pretrained_model_path, *args, **kwargs)
hanlp/components/amr/amrbart/model_interface/tokenization_bart.py:44
↓ 6 callersFunctionhuman_time_delta
(days, hours, minutes, seconds, delimiter=' ')
hanlp/utils/time_util.py:13
↓ 6 callersFunctioninitializer_1d
(input_tensor, initializer)
hanlp/components/srl/span_rank/span_ranking_srl_model.py:13
↓ 6 callersFunctionispunct
(token)
hanlp/utils/string_util.py:12
↓ 6 callersFunctionmerge_list_of_dict
(samples: List[Dict])
plugins/hanlp_common/hanlp_common/util.py:178
↓ 6 callersMethodprediction_to_human
(self, pred_ids, vocab: List[str], batch)
hanlp/components/taggers/tagger.py:179
↓ 6 callersMethodreset_dropout_mask
(self, batch_size)
hanlp/components/srl/span_rank/layer.py:98
↓ 6 callersFunctionrun_cmd
(cmd: str)
hanlp/utils/io_util.py:601
↓ 6 callersFunctionseconds_to_time_delta
(seconds)
hanlp/utils/time_util.py:32
↓ 6 callersMethodunlock
Unlock this vocab so that new tokens can be added in. Returns: Itself.
hanlp/common/vocab.py:174
↓ 6 callersMethodupdate_metric
(self, arc_preds, rel_preds, arcs, rels, mask, puncts, metric, batch=None)
hanlp/components/parsers/biaffine/biaffine_dep.py:537
↓ 5 callersMethodY_to_outputs
(self, Y: Union[tf.Tensor, Tuple[tf.Tensor]], gold=False, inputs=None, X=None, batch=None
hanlp/common/transform_tf.py:247
↓ 5 callersMethod__init__
(self, in_features, num_layers, feedforward_dim,
hanlp/layers/transformers/relative_transformer.py:278
↓ 5 callersMethod_tok_bpe
(self, token, add_space=True)
hanlp/components/amr/seq2seq/dataset/tokenization_bart.py:104
↓ 5 callersMethod_tok_bpe
(self, token)
hanlp/components/amr/amrbart/model_interface/tokenization_bart.py:83
↓ 5 callersMethod_update_penman_graph
(self, triples)
plugins/hanlp_common/hanlp_common/amr.py:343
↓ 5 callersMethodabstract_meaning_representation
Abstract Meaning Representation (AMR) captures “who is doing what to whom” in a sentence. Each sentence is represented as a rooted, directed,
plugins/hanlp_restful/hanlp_restful/__init__.py:330
↓ 5 callersMethodadd
(self, token: str)
hanlp/common/vocab_tf.py:60
↓ 5 callersFunctionbatch_make_ner_tsv_if_necessary
(json_files)
hanlp/datasets/srl/ontonotes5/_utils.py:471
↓ 5 callersMethodbuild_config
By default, call build_types_shapes_values, usually called in component's build method. You can perform other building task here. Rem
hanlp/common/transform_tf.py:51
↓ 5 callersFunctionbuild_embedding
(embeddings: Union[str, int, dict], word_vocab: VocabTF, transform: Transform)
hanlp/layers/embeddings/util_tf.py:23
↓ 5 callersFunctionclip_grad_norm
(model: nn.Module, grad_norm, transformer: nn.Module = None, transformer_grad_norm=None)
hanlp/utils/torch_util.py:167
↓ 5 callersMethodclose
(self)
hanlp/utils/io_util.py:669
↓ 5 callersFunctionget_exitcode_stdout_stderr
Execute the external command and get its exitcode, stdout and stderr. See https://stackoverflow.com/a/21000308/3730690 Args: cmd: Comma
hanlp/utils/io_util.py:584
↓ 5 callersFunctionlengths_to_mask
r""" .. code-block:: >>> seq_len = torch.arange(2, 16) >>> mask = lengths_to_mask(seq_len) >>> print(mask.size())
hanlp/utils/torch_util.py:255
↓ 5 callersMethodlinearize
(self, amr: penman.Graph)
hanlp/components/amr/seq2seq/dataset/linearization.py:170
↓ 5 callersMethodload
Load from a local/remote component. Args: save_dir: An identifier which can be a local path or a remote URL or a pre-defined stri
hanlp/common/torch_component.py:163
↓ 5 callersMethodload_weights
(self, save_dir, filename='model.pt', **kwargs)
hanlp/components/lm/mlm.py:111
↓ 5 callersFunctionmetrics
(counts)
hanlp/metrics/chunking/conlleval.py:252
↓ 5 callersMethodparse
Parse a raw document. @param text Document content which can have multiple sentences. @param tasks Tasks to perform. @param skipTasks Tasks
plugins/hanlp_restful_java/src/main/java/com/hankcs/hanlp/restful/HanLPClient.java:80
↓ 5 callersFunctionpath_from_url
Map a URL to a local path. Args: url: Remote URL. save_dir: The root folder to save this file. prefix: The prefix of offi
hanlp/utils/io_util.py:361
↓ 5 callersMethodresult
(self, full=True, verbose=True)
hanlp/metrics/chunking/conlleval.py:95
↓ 5 callersMethodsave_json
(self, path)
plugins/hanlp_common/hanlp_common/structure.py:60
↓ 5 callersMethodstart
(self)
hanlp/utils/time_util.py:216
↓ 5 callersMethodtokenize
(text: str)
hanlp/common/transform.py:422
↓ 5 callersMethodtokenize
Split a document into sentences and tokenize them. Note that it is always faster to tokenize a whole document than to tokenize each sentence
plugins/hanlp_restful/hanlp_restful/__init__.py:275
↓ 5 callersFunctionuncompress
Uncompress a file and clean up uncompressed files once an error is triggered. Args: path: The path to a compressed file dest: The des
hanlp/utils/io_util.py:204
↓ 5 callersMethodupdate
(self, dic: Dict[str, Any])
plugins/hanlp_trie/hanlp_trie/trie.py:94
↓ 4 callersMethod__init__
(self, beta=1, gamma=1, eps=1e-4, base_temperature=8)
hanlp/components/distillation/schedulers.py:114
↓ 4 callersMethod__init__
(self, filepath: str, src, dst=None, **kwargs)
hanlp/layers/embeddings/fast_text.py:27
↓ 4 callersFunction_list_treebank_root
(ctb_root)
hanlp/datasets/parsing/loaders/_ctb_utils.py:121
↓ 4 callersFunction_multi_seq_fn
()
hanlp/layers/crf/crf_tf.py:61
↓ 4 callersFunction_single_seq_fn
()
hanlp/layers/crf/crf_tf.py:48
↓ 4 callersMethodapply_gradients
(self, grads_and_vars, name=None)
hanlp/optimizers/adamw/optimization.py:167
↓ 4 callersMethodbatched_inputs_to_batches
(self, corpus, indices, shuffle)
hanlp/transform/conll_tf.py:107
↓ 4 callersFunctionbmes_to_words
(chars, tags)
hanlp/utils/span_util.py:38
↓ 4 callersMethodbuild
(self, lengths: List[int], shuffle=False, gradient_accumulation=1, **kwargs)
hanlp/common/dataset.py:788
↓ 4 callersMethodbuild_small_trie
(self)
plugins/hanlp_trie/tests/test_trie.py:7
↓ 4 callersFunctionbuild_transformer
(transformer, max_seq_length, num_labels, tagging=True, tokenizer_only=False)
hanlp/layers/transformers/loader_tf.py:10
↓ 4 callersMethodcache_dataset
(self, dataset, timer, training=False, logger=None)
hanlp/components/parsers/biaffine/biaffine_dep.py:330
↓ 4 callersFunctioncalculate_metrics
(correct, guessed, total)
hanlp/metrics/chunking/conlleval.py:222
↓ 4 callersMethodcompute_mask
(self, batch)
hanlp/components/parsers/ud/ud_parser.py:310
↓ 4 callersFunctionconfig_is
(config, model='bert')
hanlp/layers/transformers/utils_tf.py:9
↓ 4 callersMethodcopy_from
Copy properties from a dict so that it can json de-serialized. Args: item: A dict holding ``token_to_idx`` Returns:
hanlp/common/vocab.py:275
↓ 4 callersFunctioncuda_devices
Decide which GPUs to use Args: query: (Default value = None) Returns:
hanlp/utils/torch_util.py:53
↓ 4 callersMethoddecode_output
(self, logits, mask, batch, model=None)
hanlp/components/taggers/tagger.py:58
↓ 4 callersFunctionfilter_data
Filter OntoNotes5 data based on CoNLL2012 (coref) doc ids. https://github.com/bcmi220/unisrl/blob/master/scripts/filter_conll2012_data.py Arg
hanlp/datasets/srl/ontonotes5/_utils.py:147
↓ 4 callersMethodget_by_prefix
Get value by the prefix of a key. Args: prefix: The prefix of a key. If multiple keys are matched, only the first one wi
plugins/hanlp_common/hanlp_common/document.py:521
↓ 4 callersMethodget_loss
(self, arc_scores, rel_scores, arcs, rels, mask, arc_loss, rel_loss)
hanlp/components/parsers/biaffine_parser_tf.py:187
↓ 4 callersMethodget_mask
(x, p)
hanlp/components/parsers/biaffine_tf/layers.py:91
↓ 4 callersMethodget_mask
(x, p)
hanlp/layers/dropout.py:92
↓ 4 callersFunctionget_tokenizer_mirror
(transformer: str)
hanlp/layers/transformers/resource.py:29
↓ 4 callersFunctionhanlp_home
Home directory for HanLP resources. Returns: Data directory in the filesystem for storage, for example when downloading models. Thi
hanlp/utils/io_util.py:113
↓ 4 callersFunctioninit_logger
(name=None, root_dir=None, level=logging.INFO, mode='w', fmt="%(asctime)s %(levelname)s %(mess
hanlp/utils/log_util.py:29
↓ 4 callersMethodinputs_to_dataset
(self, inputs, gold=False, map_x=None, map_y=None, batch_size=32, shuffle=None, repeat=None,
hanlp/common/transform_tf.py:148
↓ 4 callersMethodload
()
hanlp/utils/lang/zh/char_table.py:35
↓ 4 callersMethodlock
(self)
hanlp/common/vocab_tf.py:115
↓ 4 callersMethodlock_vocabs
(self)
hanlp/transform/conll_tf.py:67
↓ 4 callersFunctionmake
(train)
hanlp/datasets/tokenization/sighan2005/__init__.py:12
↓ 4 callersFunctionmarkdown_table
Generate a Doxygen-flavor Markdown table from records. See https://stackoverflow.com/questions/13394140/generate-markdown-tables file -- Any
plugins/hanlp_common/hanlp_common/visualization.py:228
↓ 4 callersMethodmost_similar
Find the `topk` most similar words of a given word or phrase. Args: words: A word or phrase or multiple words/phrases.
hanlp/layers/embeddings/word2vec.py:231
↓ 4 callersFunctionpad_lists
(sequences: List[List], dtype=torch.long, padding_value=0)
hanlp/utils/torch_util.py:85
↓ 4 callersMethodparse
Parse a piece of text. Args: text: A document (str), or a list of sentences (List[str]). tokens: A list of s
plugins/hanlp_restful/hanlp_restful/__init__.py:63
↓ 4 callersFunctionpick_tensor_for_each_token
(h, token_span, average_subwords)
hanlp/layers/transformers/utils.py:81
↓ 4 callersFunctionpm_encode
(g, top=None, indent=-1, compact=False)
hanlp/components/amr/seq2seq/dataset/penman.py:72
↓ 4 callersFunctionpop_replace_append
(in_stack, out_stack, new_label)
hanlp/utils/span_util.py:599
↓ 4 callersFunctionprocess_stack
(stack, out_stack)
hanlp/utils/span_util.py:606
↓ 4 callersFunctionpushd
(new_dir)
hanlp/utils/io_util.py:609
↓ 4 callersFunctionread_conll
(filepath: Union[str, TimingFileIterator], underline_to_none=False, enhanced_collapse_empty_nodes=False)
hanlp/components/parsers/conll.py:27
↓ 4 callersMethodremove_edge
(self, x, y)
plugins/hanlp_common/hanlp_common/amr.py:392
↓ 4 callersFunctionreplace_ext
Replace the extension of filepath to ext. Args: filepath: Filepath to be replaced. ext: Extension to replace. Returns:
hanlp/utils/io_util.py:423
↓ 4 callersFunctionsanitize_conll_int_value
(value: Union[str, int])
plugins/hanlp_common/hanlp_common/conll.py:349
↓ 4 callersMethodstop
(self, total=None)
hanlp/utils/time_util.py:136
↓ 4 callersFunctiontiny_value_of_dtype
Returns a moderately tiny value for a given PyTorch data type that is used to avoid numerical issues such as division by zero. This is differe
hanlp/components/parsers/ud/udify_util.py:279
↓ 4 callersMethodtokenize
(self, text: Union[str, Sequence[str]])
plugins/hanlp_trie/hanlp_trie/dictionary.py:65
↓ 4 callersFunctionwindows
()
hanlp/utils/io_util.py:108
↓ 3 callersMethodY_to_outputs
(self, Y: Union[tf.Tensor, Tuple[tf.Tensor]], gold=False, inputs=None, X=None)
hanlp/transform/conll_tf.py:293
↓ 3 callersMethod__init__
(self, transform: CoNLL_DEP_Transform = None)
hanlp/components/parsers/biaffine_parser_tf.py:28
↓ 3 callersMethod__init__
(self, transformer_tokenizer: PreTrainedTokenizer, mask_prob=0.15)
hanlp/components/parsers/biaffine/structual_attention.py:93
↓ 3 callersMethod__init__
(self, hidden_size, config)
hanlp/components/parsers/biaffine/biaffine_2nd_dep.py:45
↓ 3 callersMethod__init__
(self, n_hidden, dropout=0, trainable=True, name=None, dtype=None, dynamic=False, **kwargs)
hanlp/components/parsers/biaffine_tf/layers.py:51
↓ 3 callersMethod__init__
(self, p: float, oov_token: int, exclude_tokens: List[int] = None)
hanlp/layers/dropout.py:10
↓ 3 callersMethod__init__
A word2vec style embedding builder which maps a token to its embedding through looking up a pre-defined table. Args: fiel
hanlp/layers/embeddings/word2vec.py:94
↓ 3 callersMethod__init__
(self, config: SerializableDict = None, map_x=True, map_y=True, lower=True, n_buckets=32, min_freq=2,
hanlp/transform/conll_tf.py:27
↓ 3 callersMethod_classify
(self, node)
hanlp/components/amr/seq2seq/dataset/tokenization_bart.py:327
← previousnext →101–200 of 2,968, ranked by callers