MCPcopy Create free account

hub / github.com/hankcs/HanLP / functions

Functions2,968 in github.com/hankcs/HanLP

↓ 1 callersMethodbuild_vocabs
(self, dataset, logger=None, transformer=None)
hanlp/components/parsers/biaffine/biaffine_dep.py:357
↓ 1 callersMethodbuild_vocabs
(self, trn, logger, **kwargs)
hanlp/components/classifiers/transformer_classifier.py:378
↓ 1 callersMethodbuild_vocabs
(self, dataset, logger, **kwargs)
hanlp/components/srl/span_rank/span_rank.py:355
↓ 1 callersMethodbuild_vocabs
(self, dataset, logger, **kwargs)
hanlp/components/srl/span_bio/span_bio.py:276
↓ 1 callersMethodbuild_vocabs
(self, dataset: SentenceBoundaryDetectionDataset, logger, **kwargs)
hanlp/components/eos/ngram.py:273
↓ 1 callersMethodcall
(self, inputs, mask_inf=True, **kwargs)
hanlp/components/parsers/biaffine_tf/model.py:85
↓ 1 callersMethodcall
(self, inputs, **kwargs)
hanlp/layers/embeddings/word2vec_tf.py:38
↓ 1 callersFunctioncheck
(x)
hanlp/components/amr/seq2seq/dataset/postprocessing.py:362
↓ 1 callersFunctioncheck
(x)
hanlp/components/amr/amrbart/common/postprocessing.py:236
↓ 1 callersFunctioncheck_outdated
Given the name of a package on PyPI and a version (both strings), checks if the given version is the latest version of the package available.
hanlp/utils/io_util.py:673
↓ 1 callersFunctioncheck_version_conflicts
(extras=None)
hanlp/utils/io_util.py:702
↓ 1 callersFunctionchu_liu_edmonds
Applies the chu-liu-edmonds algorithm recursively to a graph with edge weights defined by score_matrix. Note that this function operates
hanlp/components/parsers/chu_liu_edmonds.py:100
↓ 1 callersFunctioncky
r""" The implementation of `Cocke-Kasami-Younger`_ (CKY) algorithm to parse constituency trees. References: - Yu Zhang, Houquan Zhou
hanlp/components/parsers/alg.py:246
↓ 1 callersFunctionclean_ctb_bracketed
(ctb_root, out_root)
hanlp/datasets/parsing/loaders/_ctb_utils.py:107
↓ 1 callersMethodcleanup
(self)
hanlp/common/transform_tf.py:307
↓ 1 callersMethodclose
Closes the file handler.
hanlp/utils/file_read_backwards/file_read_backwards.py:144
↓ 1 callersMethodclose
Close this dataloader and terminates internal processes and queue. It's recommended to call this method to ensure a program can gracefully
hanlp/common/dataset.py:601
↓ 1 callersFunctioncollapse_json
Compacts a string of json data by collapsing whitespace after the specified indent level NOTE: will not produce correct results when inde
plugins/hanlp_common/hanlp_common/util.py:110
↓ 1 callersMethodcollect_additional_tokens
(self, additional_tokens, dataset)
hanlp/components/amr/seq2seq/seq2seq_amr_parser.py:89
↓ 1 callersMethodcollect_outputs_extend
(self, predictions: list, arc_preds, rel_preds, lens, mask)
hanlp/components/parsers/biaffine/biaffine_dep.py:138
↓ 1 callersMethodcompile_model
(self, optimizer, loss, metrics)
hanlp/common/keras_component.py:252
↓ 1 callersMethodcompute_distill_loss
(self, kd_criterion, out_S, out_T, mask, temperature_scheduler)
hanlp/components/taggers/transformers/transformer_tagger.py:139
↓ 1 callersMethodcompute_mask
(self, batch, offset=1)
hanlp/components/parsers/constituency/crf_constituency_parser.py:161
↓ 1 callersMethodcompute_mask
(self, mask2d)
hanlp/components/srl/span_bio/span_bio.py:215
↓ 1 callersMethodcompute_output_shape
(self, input_shape)
hanlp/layers/crf/crf_layer_tf.py:113
↓ 1 callersFunctioncompute_srl_f1
(sentences, gold_srl, predictions, gold_path=None)
hanlp/components/srl/span_rank/srl_eval_utils.py:162
↓ 1 callersMethodconfig
(self)
hanlp/common/transform.py:336
↓ 1 callersFunctionconfig_is
(config, model='bert')
hanlp/transform/transformer_tokenizer.py:554
↓ 1 callersFunctionconnect
(i, timestep)
hanlp/components/parsers/alg.py:376
↓ 1 callersFunctioncontract
(s)
hanlp/components/parsers/alg.py:453
↓ 1 callersFunctionconvert_conll_to_conllu
(path)
hanlp/datasets/parsing/semeval16.py:33
↓ 1 callersFunctionconvert_examples_to_features
Loads a data file into a list of `InputBatch`s `cls_token_at_end` define the location of the CLS token: - False (Default, BERT/XLM
hanlp/transform/transformer_tokenizer.py:558
↓ 1 callersFunctionconvert_jsonlines_to_IOBES
(json_file, output_file=None, doc_level_offset=True, normalize_token=False)
hanlp/datasets/srl/ontonotes5/_utils.py:432
↓ 1 callersFunctionconvert_to_jsonlines
(input_path, output_path, language, labels=None, stats=None)
hanlp/datasets/srl/ontonotes5/_utils.py:349
↓ 1 callersMethodcopy
(self)
plugins/hanlp_common/hanlp_common/amr.py:242
↓ 1 callersMethodcopy_from
(self, item: dict)
hanlp/common/vocab_tf.py:203
↓ 1 callersMethodcoreference_resolution
r""" Coreference resolution is the task of clustering mentions in text that refer to the same underlying real world entities. Args:
plugins/hanlp_restful/hanlp_restful/__init__.py:232
↓ 1 callersMethodcount_sentences
Count number of sentences in this document. Returns: Number of sentences.
plugins/hanlp_common/hanlp_common/document.py:536
↓ 1 callersFunctioncreate_label_vocab
()
hanlp/common/vocab_tf.py:269
↓ 1 callersMethodcreate_model
(self, pretrained_embed, transformer)
hanlp/components/parsers/biaffine/biaffine_dep.py:410
↓ 1 callersMethodcreate_types_shapes_values
Create dataset related values,
hanlp/common/transform_tf.py:68
↓ 1 callersFunctioncrf_binary_score
Computes the binary scores of tag sequences. Args: tag_indices: A [batch_size, max_seq_len] matrix of tag indices. sequence_lengths:
hanlp/layers/crf/crf_tf.py:256
↓ 1 callersFunctioncrf_decode_backward
Computes backward decoding in a linear-chain CRF. Args: inputs: A [batch_size, num_tags] matrix of backpointer of next step (in time or
hanlp/layers/crf/crf_tf.py:437
↓ 1 callersFunctioncrf_decode_forward
Computes forward decoding in a linear-chain CRF. Args: inputs: A [batch_size, num_tags] matrix of unary potentials. state: A [batch_s
hanlp/layers/crf/crf_tf.py:414
↓ 1 callersFunctioncrf_forward
Computes the alpha values in a linear-chain CRF. See http://www.cs.columbia.edu/~mcollins/fb.pdf for reference. Args: inputs: A [b
hanlp/layers/crf/crf_tf.py:295
↓ 1 callersFunctioncrf_log_likelihood
Computes the log-likelihood of tag sequences in a CRF. Args: inputs: A [batch_size, max_seq_len, num_tags] tensor of unary potentials t
hanlp/layers/crf/crf_tf.py:175
↓ 1 callersFunctioncrf_sequence_score
Computes the unnormalized score for a tag sequence. Args: inputs: A [batch_size, max_seq_len, num_tags] tensor of unary potentials to u
hanlp/layers/crf/crf_tf.py:27
↓ 1 callersFunctioncrf_unary_score
Computes the unary scores of tag sequences. Args: tag_indices: A [batch_size, max_seq_len] matrix of tag indices. sequence_lengths: A
hanlp/layers/crf/crf_tf.py:216
↓ 1 callersFunctioncwsm_temperature_scheduler_builder
adapted from arXiv:1911.07471
hanlp/components/distillation/schedulers.py:44
↓ 1 callersMethoddataset_document_iterator
An iterator over CONLL formatted files which yields documents, regardless of the number of document annotations in a particular file.
hanlp/datasets/srl/loaders/ontonotes_loader.py:205
↓ 1 callersMethoddataset_document_iterator
An iterator over CONLL formatted files which yields documents, regardless of the number of document annotations in a particular file. This is
hanlp/datasets/coref/loaders/conll12coref.py:16
↓ 1 callersFunctiondataset_from_generator
(generator, char_vocab, ngram_vocab, tag_vocab, bigram_only=False, window_size=4, b
hanlp/transform/txt_tf.py:129
↓ 1 callersFunctiondataset_from_generator
(generator, word_vocab, tag_vocab, batch_size=32, shuffle=None, repeat=None, prefetch=1,
hanlp/transform/tsv_tf.py:26
↓ 1 callersMethoddataset_path_iterator
An iterator returning file_paths in a directory containing CONLL-formatted files.
hanlp/datasets/srl/loaders/ontonotes_loader.py:189
↓ 1 callersMethoddecode
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:324
↓ 1 callersMethoddecode
(arc_d, arc_h, rel_d, rel_h, mask, arc_attn, rel_attn)
hanlp/components/parsers/biaffine/biaffine_model.py:189
↓ 1 callersMethoddecode_amr
(self, tokens, restore_name_ops=False)
hanlp/components/amr/seq2seq/dataset/tokenization_t5.py:213
↓ 1 callersMethoddecode_amr
(self, tokens, restore_name_ops=None)
hanlp/components/amr/amrbart/model_interface/tokenization_bart.py:141
↓ 1 callersFunctiondecode_dep
r""" Args: s_arc (~torch.Tensor): ``[batch_size, seq_len, seq_len]``. Scores of all possible arcs. mask (~torch.BoolTe
hanlp/components/parsers/alg.py:733
↓ 1 callersFunctiondecode_mst
Note: Counter to typical intuition, this function decodes the _maximum_ spanning tree. Decode the optimal MST tree with the Chu-Liu-Edmon
hanlp/components/parsers/chu_liu_edmonds.py:8
↓ 1 callersMethoddecode_output
(self, logits, mask, batch, model=None)
hanlp/components/tokenizers/transformer.py:108
↓ 1 callersMethoddecode_output
(self, logits, mask, batch, model=None)
hanlp/components/ner/transformer_ner.py:46
↓ 1 callersMethoddecode_output
(self, output_dict, batch, training=False)
hanlp/components/srl/span_rank/span_rank.py:385
↓ 1 callersMethoddecorate_spans
(self, spans, batch)
hanlp/components/ner/transformer_ner.py:104
↓ 1 callersFunctiondep_to_levi
(tok: List[str], dep: List[Tuple[int, str]])
hanlp/components/amr/seq2seq/dataset/dataset.py:220
↓ 1 callersMethoddetach_tensors
If you actually passed gradient-tracking Tensors to a Metric, there will be a huge memory leak, because it will prevent garbage colle
hanlp/metrics/accuracy.py:109
↓ 1 callersMethoddetach_tensors
If you actually passed gradient-tracking Tensors to a Metric, there will be a huge memory leak, because it will prevent garbage colle
hanlp/metrics/accuracy.py:220
↓ 1 callersFunctiondfs
(tok: List[str], dep: List[Tuple[int, str]], s, seq)
hanlp/components/amr/seq2seq/dataset/dataset.py:227
↓ 1 callersFunctiondfs
(graph, start, end)
hanlp/components/parsers/parse_alg.py:221
↓ 1 callersMethoddo
(graph, nodes)
plugins/hanlp_common/hanlp_common/amr.py:885
↓ 1 callersFunctiondownload
(url, save_path=None, save_dir=hanlp_home(), prefix=HANLP_URL, append_location=True, verbose=HANLP_VERBOSE)
hanlp/utils/io_util.py:144
↓ 1 callersFunctioneisner2o
r""" Second-order Eisner algorithm for projective decoding. This is an extension of the first-order one that further incorporates sibling scor
hanlp/components/parsers/alg.py:566
↓ 1 callersMethodembed
(self, sents: List[List[str]], vocab: Dict[str, int])
hanlp/layers/embeddings/contextual_string_embedding.py:111
↓ 1 callersMethodembed
Embedding sentences (list of words) with contextualized string embedding Args: texts: List of words, not chars texts: Lis
hanlp/layers/embeddings/contextual_string_embedding_tf.py:52
↓ 1 callersFunctionembeddings_require_char_input
(embeddings)
hanlp/layers/embeddings/util_tf.py:85
↓ 1 callersFunctionend_of_chunk
Checks if a chunk ended between the previous and current word. Args: prev_tag: previous chunk tag. tag: current chunk tag. prev
hanlp/metrics/chunking/sequence_labeling.py:83
↓ 1 callersFunctionensure_python_points_to_python2
()
hanlp/datasets/srl/ontonotes5/_utils.py:405
↓ 1 callersMethodevaluate
(self, save_dir=None, logger: logging.Logger = None, batch_size=None, output=False, **kwargs)
hanlp/components/mtl/multi_task_learning.py:755
↓ 1 callersMethodevaluate
(self, input_path: str, save_dir=None, output=False, batch_size=128, logger: logging.Logger = None,
hanlp/common/keras_component.py:49
↓ 1 callersMethodevaluate_dataloader
(self, data: DataLoader, criterion: Callable, metric=None, output=False, ratio_width=None,
hanlp/components/amr/seq2seq/seq2seq_amr_parser.py:221
↓ 1 callersMethodevaluate_dataloader
(self, data: DataLoader, criterion: Callable,
hanlp/components/ner/biaffine_ner/biaffine_ner.py:151
↓ 1 callersMethodevaluate_dataloader
(self, data, criterion, logger=None, ratio_width=None, metric=None, output=None, **kwargs)
hanlp/components/parsers/constituency/crf_constituency_parser.py:183
↓ 1 callersMethodevaluate_dataloader
(self, data: DataLoader, criterion: Callable,
hanlp/components/parsers/ud/ud_parser.py:105
↓ 1 callersMethodevaluate_dataloader
(self, loader: PadSequenceDataLoader, criterion, logger=None, filename=None, output=False,
hanlp/components/parsers/biaffine/biaffine_dep.py:499
↓ 1 callersMethodevaluate_dataloader
(self, data: DataLoader, criterion: Callable,
hanlp/components/classifiers/transformer_classifier.py:206
↓ 1 callersMethodevaluate_dataloader
(self, data: DataLoader, logger: logging.Logger, metric=None, output=False, **kwargs)
hanlp/components/sts/transformer_sts.py:130
↓ 1 callersMethodevaluate_dataloader
(self, data: DataLoader, criterion: Callable,
hanlp/components/srl/span_rank/span_rank.py:156
↓ 1 callersMethodevaluate_dataloader
(self, data: DataLoader, criterion: Callable, metric, logger, ratio_width=None, fi
hanlp/components/srl/span_bio/span_bio.py:355
↓ 1 callersMethodevaluate_dataloader
(self, data: DataLoader, criterion: Callable,
hanlp/components/eos/ngram.py:155
↓ 1 callersMethodevaluate_dataloader
(self, data: MultiTaskDataLoader, criterion,
hanlp/components/mtl/multi_task_learning.py:389
↓ 1 callersMethodevaluate_dataloader
Evaluate on a dataloader. Args: data: Dataloader which can build from any data source. criterion: Loss function.
hanlp/common/torch_component.py:422
↓ 1 callersMethodevaluate_dataset
(self, tst_data, callbacks, output, num_batches, **kwargs)
hanlp/common/keras_component.py:105
↓ 1 callersFunctionevaluate_iob2
(true_seqs, pred_seqs)
hanlp/metrics/chunking/conlleval.py:207
↓ 1 callersMethodevaluate_output
(self, tst_data, out, num_batches, metrics: List[tf.keras.metrics.Metric])
hanlp/common/keras_component.py:109
↓ 1 callersMethodevaluate_output_to_file
(self, batch, outputs, out)
hanlp/common/keras_component.py:121
↓ 1 callersFunctionevalute_field
Evalute a field of a record using the type of the field_spec as a guide. Args: record: field_spec: Returns:
plugins/hanlp_common/hanlp_common/visualization.py:210
↓ 1 callersMethodexclusive_cumsum
Args: input: input is the sentence lengths tensor. exclusive: exclude the last sentence length (Default value = True)
hanlp/components/srl/span_rank/span_ranking_srl_model.py:114
↓ 1 callersMethodexecute_training_loop
Implement this to run training loop. Args: trn: Training set. dev: Development set. epochs: Number of epo
hanlp/common/torch_component.py:387
↓ 1 callersMethodexport_model_for_serving
(self, export_dir=None, version=1, overwrite=False, show_hint=False)
hanlp/common/keras_component.py:490
↓ 1 callersFunctionextract_bmes_tag_label
(text)
hanlp/utils/span_util.py:700
← previousnext →801–900 of 2,968, ranked by callers