MCPcopy Create free account

hub / github.com/hankcs/HanLP / functions

Functions2,968 in github.com/hankcs/HanLP

↓ 1 callersMethodinput_is_flat
Check whether the data is flat (meaning that it's only a single sample, not even batched). Returns: bool: ``True`` to in
hanlp/components/mtl/tasks/__init__.py:182
↓ 1 callersMethodinput_is_single_sample
(self, input: Union[List[str], List[List[str]]])
hanlp/components/tokenizers/tok_tf.py:39
↓ 1 callersMethodinput_is_single_sample
(self, input: Any)
hanlp/common/transform_tf.py:269
↓ 1 callersMethodinput_to_inputs
If input is one sample, convert it to a list which contains this unique sample Parameters ---------- input :
hanlp/common/transform_tf.py:272
↓ 1 callersMethodinput_truth_output_to_str
(self, input: List[str], truth: List[str], output: List[str])
hanlp/components/taggers/ngram_conv/ngram_conv_tagger.py:79
↓ 1 callersMethodinput_truth_output_to_str
Convert input truth output to string representation, usually for writing to file during evaluation Parameters ----------
hanlp/common/transform_tf.py:291
↓ 1 callersMethodinside
(self, scores, mask)
hanlp/components/parsers/constituency/treecrf.py:78
↓ 1 callersFunctionis_abstract_token
(token)
plugins/hanlp_common/hanlp_common/amr.py:55
↓ 1 callersFunctionis_english_punct
(c)
plugins/hanlp_common/hanlp_common/amr.py:59
↓ 1 callersMethodis_named_entity
(self, index)
plugins/hanlp_common/hanlp_common/amr.py:105
↓ 1 callersFunctionis_similar
(instances1, instances2)
plugins/hanlp_common/hanlp_common/amr.py:865
↓ 1 callersMethodis_sp_root
(self)
hanlp/datasets/qa/hotpotqa.py:140
↓ 1 callersMethodis_sp_root_candidate
(self)
hanlp/datasets/qa/hotpotqa.py:143
↓ 1 callersFunctionis_transition_allowed
Given a constraint type and strings `from_tag` and `to_tag` that represent the origin and destination of the transition, return whether t
hanlp/utils/span_util.py:147
↓ 1 callersFunctionk_fold
(k, total, i)
plugins/hanlp_common/hanlp_common/util.py:203
↓ 1 callersMethodkeyphrase_extraction
Keyphrase extraction aims to identify keywords or phrases reflecting the main topics of a document. Args: text: The text content
plugins/hanlp_restful/hanlp_restful/__init__.py:369
↓ 1 callersFunctionkmeans
r""" KMeans algorithm for clustering the sentences by length. Args: x (list[int]): The list of sentence lengths.
hanlp/components/parsers/alg.py:29
↓ 1 callersFunctionkmeans
See https://github.com/zysite/biaffine-parser/blob/master/parser/utils/alg.py#L7 Args: x(list): Lengths of sentences k(int): s
hanlp/components/parsers/alg_tf.py:33
↓ 1 callersFunctionlabel
(title_, index_)
hanlp/datasets/qa/hotpotqa.py:85
↓ 1 callersMethodlanguage_identification
Identify the language of a given text. Args: text: A document or a list of documents. topk: ``True`` or ``in
plugins/hanlp_restful/hanlp_restful/__init__.py:553
↓ 1 callersMethodlast_transform
(self)
hanlp/components/tokenizers/transformer.py:236
↓ 1 callersMethodlast_transform
(self)
hanlp/components/taggers/transformers/transformer_tagger.py:207
↓ 1 callersMethodlen_of_sent
(self, sent)
hanlp/transform/conll_tf.py:541
↓ 1 callersFunctionlevi_amr
(concept, edge, extra_arc=False)
hanlp/datasets/parsing/amr.py:182
↓ 1 callersFunctionlinearize
(concept: List, edge: List, label='', prefix=REL, extra_arc=False)
hanlp/datasets/parsing/amr.py:259
↓ 1 callersFunctionlist_to_tree
(L)
plugins/hanlp_common/hanlp_common/visualization.py:174
↓ 1 callersMethodload
(self, save_dir: str, logger=hanlp.utils.log_util.logger, **kwargs)
hanlp/common/keras_component.py:210
↓ 1 callersMethodload_config
Load config from a directory. Args: save_dir: The directory to load config. filename: A file name for config.
hanlp/common/torch_component.py:115
↓ 1 callersMethodload_data
A intermediate step between constructor and calling the actual file loading method. Args: data: If data is a file, this method ca
hanlp/common/dataset.py:139
↓ 1 callersMethodload_file
The actual file loading logic. Args: filepath: The path to a dataset.
hanlp/common/dataset.py:178
↓ 1 callersMethodload_file
(self, filepath)
hanlp/datasets/lm/loaders/lm_dataset.py:66
↓ 1 callersMethodload_meta
(self, save_dir, filename='meta.json')
hanlp/common/keras_component.py:154
↓ 1 callersFunctionload_raw_text
(onf_file)
hanlp/datasets/srl/ontonotes5/_utils.py:608
↓ 1 callersMethodload_transform
Try to load transform only. This method might fail due to the fact it avoids building the model. If it do fail, then you have to use
hanlp/common/keras_component.py:192
↓ 1 callersMethodload_vocabs
Load vocabularies from a directory. Args: save_dir: The directory to load vocabularies. filename: The name for vocab
hanlp/common/torch_component.py:141
↓ 1 callersMethodload_weights
(self, save_dir, filename='model.pt', **kwargs)
hanlp/components/amr/amrbart/bart_amr_parser.py:166
↓ 1 callersMethodload_weights
Load weights from a directory. Args: save_dir: The directory to load weights from. filename: A file name for weights.
hanlp/common/torch_component.py:89
↓ 1 callersMethodloss
r""" Args: s_arc (~torch.Tensor): ``[batch_size, seq_len, seq_len]``. Scores of all possible arcs. s_s
hanlp/components/parsers/constituency/treecrf.py:255
↓ 1 callersFunctionmain
()
hanlp/components/amr/amrbart/preprocess/read_and_process.py:82
↓ 1 callersFunctionmain
()
hanlp/utils/log_util.py:150
↓ 1 callersFunctionmain
()
hanlp/utils/torch_util.py:154
↓ 1 callersFunctionmain
hanlp/metrics/parsing/semdep_eval.py:122
↓ 1 callersFunctionmain
(argv)
hanlp/metrics/chunking/conlleval.py:332
↓ 1 callersFunctionmain
()
hanlp/layers/embeddings/contextual_string_embedding.py:192
↓ 1 callersFunctionmain
()
hanlp/datasets/lu/glue.py:19
↓ 1 callersFunctionmain
()
hanlp/datasets/parsing/ud/ud27.py:37
↓ 1 callersFunctionmain
()
hanlp/datasets/parsing/ud/ud210.py:37
↓ 1 callersFunctionmain
()
hanlp/datasets/parsing/ud/ud23.py:29
↓ 1 callersFunctionmain
()
hanlp/datasets/srl/ontonotes5/_utils.py:667
↓ 1 callersFunctionmain
()
hanlp/transform/transformer_tokenizer.py:698
↓ 1 callersFunctionmain
()
plugins/hanlp_common/hanlp_common/visualization.py:189
↓ 1 callersFunctionmain
()
plugins/hanlp_demo/hanlp_demo/mul/train/mul_base.py:17
↓ 1 callersFunctionmake_batch_for_bart
(augmented_concept, ret, tokenizer, device, training=True)
hanlp/datasets/parsing/amr.py:160
↓ 1 callersFunctionmake_batch_for_squeeze
(data, augmented_concept, tokenizer, device, ret)
hanlp/datasets/parsing/amr.py:210
↓ 1 callersFunctionmake_con_txt
(conll_file, output_file)
hanlp/datasets/srl/ontonotes5/_utils.py:499
↓ 1 callersFunctionmake_con_txt_if_necessary
(json_file)
hanlp/datasets/srl/ontonotes5/_utils.py:518
↓ 1 callersFunctionmake_coref_instance
# Parameters sentences : `List[List[str]]`, required. A list of lists representing the tokenised words and sentences in the document
hanlp/datasets/srl/loaders/ontonotes_loader.py:463
↓ 1 callersFunctionmake_coref_json
(json_file, output_file)
hanlp/datasets/srl/ontonotes5/_utils.py:604
↓ 1 callersFunctionmake_coref_json_if_necessary
(json_file)
hanlp/datasets/srl/ontonotes5/_utils.py:582
↓ 1 callersFunctionmake_ctb_tasks
(chtbs, out_root, part)
hanlp/datasets/parsing/loaders/_ctb_utils.py:160
↓ 1 callersFunctionmake_dep_conllx
(con_txt_file, output_file, language='en')
hanlp/datasets/srl/ontonotes5/_utils.py:539
↓ 1 callersFunctionmake_dep_conllx_if_necessary
(con_txt_file: str, language='en')
hanlp/datasets/srl/ontonotes5/_utils.py:544
↓ 1 callersFunctionmake_ner_json
(json_file, output_file)
hanlp/datasets/srl/ontonotes5/_utils.py:570
↓ 1 callersFunctionmake_ner_json_if_necessary
(json_file)
hanlp/datasets/srl/ontonotes5/_utils.py:557
↓ 1 callersFunctionmake_ner_tsv_if_necessary
(json_file)
hanlp/datasets/srl/ontonotes5/_utils.py:463
↓ 1 callersFunctionmake_ontonotes_jsonlines
(conll12_ontonotes_path, output_path, languages=None)
hanlp/datasets/srl/ontonotes5/_utils.py:364
↓ 1 callersFunctionmake_pos_tsv
(json_file, output_file)
hanlp/datasets/srl/ontonotes5/_utils.py:484
↓ 1 callersFunctionmake_pos_tsv_if_necessary
(json_file)
hanlp/datasets/srl/ontonotes5/_utils.py:476
↓ 1 callersFunctionmake_srl_json
(json_file, output_file)
hanlp/datasets/srl/ontonotes5/_utils.py:595
↓ 1 callersFunctionmake_srl_json_if_necessary
(json_file)
hanlp/datasets/srl/ontonotes5/_utils.py:574
↓ 1 callersFunctionmasked_conv1d_and_max
Applies 1d convolution and a masked max-pooling https://github.com/guillaumegenthial/tf_ner/blob/master/models/chars_conv_lstm_crf/masked_con
hanlp/layers/embeddings/char_cnn_tf.py:59
↓ 1 callersMethodmerge_batch
A helper method to merge the outputs of split batch back by concatenating the output per span with the key used to split it. It's used in con
plugins/hanlp_trie/hanlp_trie/dictionary.py:106
↓ 1 callersMethodmodule
(self, **kwargs)
hanlp/layers/embeddings/fast_text.py:106
↓ 1 callersMethodmodule
(self, vocabs: VocabDict, **kwargs)
hanlp/layers/embeddings/word2vec.py:139
↓ 1 callersFunctionmodule_path_of
(func)
plugins/hanlp_common/hanlp_common/reflection.py:22
↓ 1 callersFunctionmove_dict_to_device
(ret, device)
hanlp/datasets/parsing/amr.py:194
↓ 1 callersMethodnext
Returns unicode string from the last line until the beginning of file. Gets exhausted if:: * already reached the
hanlp/utils/file_read_backwards/file_read_backwards.py:101
↓ 1 callersFunctionno_decay_fn
(name)
hanlp/layers/transformers/utils.py:269
↓ 1 callersFunctionnonzero
(t: tf.Tensor)
hanlp/components/parsers/alg_tf.py:11
↓ 1 callersFunctionnonzero
(t: tf.Tensor)
hanlp/components/parsers/biaffine_tf/alg.py:11
↓ 1 callersFunctionnormalize_word
(word, language)
hanlp/datasets/srl/ontonotes5/_utils.py:224
↓ 1 callersFunctionnow_datetime
()
hanlp/utils/time_util.py:231
↓ 1 callersFunctionnow_filename
Generate filename using current datetime, in 20180102_030405 format Args: fmt: (Default value = "%y%m%d_%H%M%S") Returns:
hanlp/utils/time_util.py:235
↓ 1 callersFunctionnow_human
(year='y')
hanlp/utils/time_util.py:226
↓ 1 callersFunctionofficial_conll_05_evaluate
(pred_path, gold_path)
hanlp/metrics/srl/srlconll.py:9
↓ 1 callersMethodon_train_begin
(self)
hanlp/components/parsers/biaffine_parser_tf.py:504
↓ 1 callersMethodon_train_end
(self, logs=None)
hanlp/callbacks/fine_csv_logger.py:48
↓ 1 callersFunctionontonotes_document_generator
(input_path, language, labels, stats)
hanlp/datasets/srl/ontonotes5/_utils.py:339
↓ 1 callersMethodparallelize
(self, devices: List[Union[int, torch.device]])
hanlp/common/torch_component.py:570
↓ 1 callersFunctionparent_dir
(path)
hanlp/utils/io_util.py:140
↓ 1 callersFunctionparse_args
(argv)
hanlp/metrics/chunking/conlleval.py:117
↓ 1 callersMethodparse_longest
Longest-prefix-matching which tries to match the longest keyword sequentially from the head of the text till its tail. By definition, the matc
plugins/hanlp_trie/hanlp_trie/dictionary.py:184
↓ 1 callersFunctionparse_url_path
(url)
hanlp/utils/io_util.py:198
↓ 1 callersFunctionprecision_score
Compute the precision. The precision is the ratio ``tp / (tp + fp)`` where ``tp`` is the number of true positives and ``fp`` the number o
hanlp/metrics/chunking/sequence_labeling.py:218
↓ 1 callersMethodpredict
(self, word: str, doc2vec=False, **kwargs)
hanlp/layers/embeddings/word2vec.py:222
↓ 1 callersMethodpredict
Predict on data. This is the base class for all components, including rule based and statistical ones. Args: *args: Any type of dat
hanlp/common/component.py:13
↓ 1 callersMethodpredict_batch
(self, batch, num_beams, max_length)
hanlp/components/amr/amrbart/bart_amr_generation.py:105
↓ 1 callersMethodpredict_batch
(self, batch, inputs=None, **kwargs)
hanlp/common/keras_component.py:460
↓ 1 callersMethodpredict_data
(self, data, batch_size, sampler_builder=None, **kwargs)
hanlp/components/taggers/tagger.py:159
↓ 1 callersMethodprediction_to_head_rel
(self, arcs: torch.LongTensor, rels: torch.LongTensor, batch: dict)
hanlp/components/parsers/biaffine/biaffine_dep.py:565
← previousnext →1,001–1,100 of 2,968, ranked by callers