MCPcopy Create free account

hub / github.com/amazon-science/ReFinED / functions

Functions427 in github.com/amazon-science/ReFinED

↓ 2 callersMethodget_msnbc_docs
( self, split: str, include_spans: bool = True, include_gold_l
src/refined/dataset_reading/entity_linking/dataset_factory.py:186
↓ 2 callersMethodget_parameters_not_to_scale
Gets parameters that can be scaled during training. Usually top/last layers. :return: list of parameters
src/refined/model_components/ed_layer_2.py:54
↓ 2 callersMethodget_precision
(self)
src/refined/evaluation/metrics.py:57
↓ 2 callersMethodget_precision_md
(self)
src/refined/evaluation/metrics.py:68
↓ 2 callersFunctionget_qcode_classes
(qcode: str, occupations, sports, country, instance_of, class_explorer, chosen_classes: Set[str],
src/refined/offline_data_generation/generate_qcode_to_type_indices.py:117
↓ 2 callersMethodget_recall
(self)
src/refined/evaluation/metrics.py:60
↓ 2 callersMethodget_recall_md
(self)
src/refined/evaluation/metrics.py:71
↓ 2 callersMethodget_training_data_files
(self)
src/refined/resource_management/resource_manager.py:161
↓ 2 callersMethodget_training_data_files_info
(self)
src/refined/resource_management/resource_manager.py:141
↓ 2 callersFunctionignoreTag
(tag)
src/refined/offline_data_generation/wiki_extractor.py:358
↓ 2 callersMethodinit_from_pretrained
(cls, model_dir: str, device: str = "cpu", n_gpu: int = 1)
src/refined/inference/standalone_md.py:164
↓ 2 callersFunctionload_country
(file_path: str, is_test: bool = False)
src/refined/resource_management/loaders.py:247
↓ 2 callersFunctionload_occuptations
(file_path: str, is_test: bool = False)
src/refined/resource_management/loaders.py:217
↓ 2 callersFunctionload_sports
(file_path: str, is_test: bool = False)
src/refined/resource_management/loaders.py:232
↓ 2 callersFunctionmerge_files_and_extract_links
(input_dir: str, resources_dir: str, output_dir: str)
src/refined/offline_data_generation/merge_files_and_extract_links.py:91
↓ 2 callersFunctionnormalizeNamespace
(ns)
src/refined/offline_data_generation/wiki_extractor.py:1718
↓ 2 callersFunctionpad
Pad a list of lists to a list of equal length lists. :param inputs: list of lists :param seq_len: seq len to pad to. -1 means take the lo
src/refined/utilities/preprocessing_utils.py:444
↓ 2 callersFunctionpreprocess_wikipedia
Initiate wikipedia preprocessing (cleaning of text, removing tables etc.) using wiki_extractor.py Cleaned dump will be around 18GB
src/refined/offline_data_generation/clean_wikipedia.py:25
↓ 2 callersMethodprocess_tensors
Performs an forward pass of ReFinED model and returns the spans for the batch. :param batch: tensors for the batch elements in the ba
src/refined/inference/processor.py:273
↓ 2 callersMethodread_file_as_docs
Each doc is a list of sentences, each sentence is a list of tokens (tuples) :param file_path: file path :param bio_only: bio
src/refined/dataset_reading/mention_detection/conll_reader.py:118
↓ 2 callersFunctionremove_wiki_brackets
(title: str)
src/refined/resource_management/loaders.py:210
↓ 2 callersMethodresolve_multiple
Given a list of dates all of which are from the same doc/page, check to see if can resolve any additional dates by identifying the fo
src/refined/utilities/numeric_handling/date_utils.py:120
↓ 2 callersFunctionrun_checkpoint_eval_and_save
(best_f1: float, evaluation_dataset_name_to_docs: Dict[str, Iterable[Doc]], f
src/refined/training/fine_tune/fine_tune.py:150
↓ 2 callersFunctionrun_fine_tuning_loops
(refined: Refined, fine_tuning_args: TrainingArgs, training_dataloader: DataLoader,
src/refined/training/fine_tune/fine_tune.py:101
↓ 2 callersMethodset_non_test_attrs
Used for testing - set attributes not defined in the test instances to None
src/refined/utilities/numeric_handling/date_utils.py:232
↓ 2 callersFunctionsplitParts
:param paramsList: the parts of a template or tplarg. Split template parameters at the separator "|". separator "=". Template paramet
src/refined/offline_data_generation/wiki_extractor.py:1115
↓ 2 callersFunctionstart_fine_tuning_task
(refined: 'Refined', train_docs: Iterable[Doc], evaluation_dataset_name_to_docs: Di
src/refined/training/fine_tune/fine_tune.py:50
↓ 2 callersMethodtemplateParams
Build a dictionary with positional or name key to expanded parameters. :param parameters: the parts[1:] of a template, i.e. all excep
src/refined/offline_data_generation/wiki_extractor.py:878
↓ 2 callersFunctiontitle_to_qcode
( wiki_title: str, redirects: Dict[str, str], wikipedia_to_qcode: Dict[str, str],
src/refined/offline_data_generation/generate_pem.py:25
↓ 2 callersMethodto_file
(self, filename: str)
src/refined/training/fine_tune/fine_tune_args.py:67
↓ 2 callersFunctiontrain_md_model
( resources_dir: str, datasets: List[str], transformer_name: str = "roberta-base", attention_p
src/refined/training/train/train_md_standalone.py:33
↓ 2 callersMethodtransform1
Transform text not containing <nowiki>
src/refined/offline_data_generation/wiki_extractor.py:698
↓ 2 callersMethodwikidata_qcode_is_disambiguation_page
(self, qcode: str)
src/refined/doc_preprocessing/wikidata_mapper.py:30
↓ 1 callersMethod__post_init__
(self)
src/refined/training/train/training_args.py:56
↓ 1 callersMethod_check_for_incorrect_resolution
Rule based techniques for filtering out any dates which are potentially incorrect
src/refined/utilities/numeric_handling/date_utils.py:361
↓ 1 callersMethod_expand_candidates_classes_tensor
( self, candidates_classes: Tensor, index_tensor: Tensor, device: str )
src/refined/model_components/refined_model.py:585
↓ 1 callersMethod_expand_class_targets
( self, class_targets: Tensor, index_tensor: Tensor )
src/refined/model_components/refined_model.py:569
↓ 1 callersMethod_expand_tensors
Expands tensors, A, using boolean tensor, B. Where B is a boolean tensor with B.shape = A.shape[:-1]. For example, tensor A could rep
src/refined/model_components/refined_model.py:543
↓ 1 callersMethod_explore_class_tree
Recursively explores the class hierarchy (parent classes, parent of parents, etc.) Returns all the explored classes (these are all im
src/refined/doc_preprocessing/class_handler.py:58
↓ 1 callersMethod_filepath
(self)
src/refined/offline_data_generation/wiki_extractor.py:2686
↓ 1 callersMethod_get_date_formats
Given a list of dates, see if we can identify whether dates in the list are "month_first" or "day_first" format :param dates: list of
src/refined/utilities/numeric_handling/date_utils.py:145
↓ 1 callersMethod_get_mention_embeddings
( self, sequence_output: Tensor, token_acc_sums: Tensor, entity_mask: Tensor )
src/refined/model_components/refined_model.py:345
↓ 1 callersMethod_identify_entity_mentions
Note that this add spans to batch_elements in-place. :param attention_mask: attention mask :param batch_elements: batch_eleme
src/refined/model_components/refined_model.py:382
↓ 1 callersFunction_is_namedtuple
(obj)
src/refined/torch_overrides/data_parallel_refined.py:15
↓ 1 callersMethod_prune_span_ner
Removes impliable classes from span (in-place). :param span: span
src/refined/inference/processor.py:410
↓ 1 callersMethod_split_date_text
Split date string into multiple parts, each of which refers to a single date. E.g. "1988 to 1999" -> ["1988", "1999"]. Keeps track of
src/refined/utilities/numeric_handling/date_utils.py:162
↓ 1 callersMethod_to_batch_elements_e2e
E2E version of to_batch_elements(). Converts `Doc` to list of batch elements. When the doc has fewer than max sequence length
src/refined/data_types/doc_types.py:275
↓ 1 callersMethodadd_command_line_args
(self, args)
src/refined/training/fine_tune/fine_tune_args.py:54
↓ 1 callersMethodadd_command_line_args
(self, args)
src/refined/training/train/training_args.py:69
↓ 1 callersFunctionadd_spans
(aligned_wiki_file: str, output_dir: str, device: str, start_line: int, end_line: int, model_dir: str,
src/refined/offline_data_generation/run_span_detection.py:101
↓ 1 callersMethodadd_spans
Adds spans, acc_sum, entity_mask to BatchElement. param spans: list of spans to add :return: no return modifies self in-place
src/refined/data_types/modelling_types.py:137
↓ 1 callersFunctionadd_spans_to_existing_datasets
(dataset_names: List[str], dataset_dir: str, model_dir: str, file_extension
src/refined/offline_data_generation/run_span_detection.py:123
↓ 1 callersFunctionbuild_class_labels
(resources_dir: str)
src/refined/offline_data_generation/preprocess_all.py:125
↓ 1 callersFunctionbuild_entity_index
(pem_filename: str, output_path: str)
src/refined/offline_data_generation/preprocess_all.py:112
↓ 1 callersFunctionbuild_lmdb_dicts
(preprocess_all_data_dir: str, keep_all_entities: bool)
src/refined/offline_data_generation/build_lmdb_dicts.py:11
↓ 1 callersFunctionbuild_pem_lookup
(aligned_wiki_file: str, output_dir: str, resources_dir: str, is_test: bool = False, add_
src/refined/offline_data_generation/generate_pem.py:46
↓ 1 callersFunctioncallParserFunction
Parser functions have similar syntax as templates, except that the first argument is everything after the first colon. :return: the resul
src/refined/offline_data_generation/wiki_extractor.py:1910
↓ 1 callersMethodcan_identify_format
Check if we can identify whether this dates is in day-first or month-first format
src/refined/utilities/numeric_handling/date_utils.py:34
↓ 1 callersMethodclass_check_span
(self, span_to_check: Span)
src/refined/doc_preprocessing/class_handler.py:104
↓ 1 callersMethodclean
Removes irrelevant parts from :param: text.
src/refined/offline_data_generation/wiki_extractor.py:765
↓ 1 callersMethodclose
(self)
src/refined/resource_management/lmdb_wrapper.py:65
↓ 1 callersMethodcollate
Collates a list of tensors for batch elements into a single batch. - Pads tensors to longest length in batch - Corrects masks
src/refined/dataset_reading/entity_linking/document_dataset.py:80
↓ 1 callersFunctioncompact
Deal with headers, lists, empty sections, residuals of tables. :param text: convert to HTML.
src/refined/offline_data_generation/wiki_extractor.py:2520
↓ 1 callersFunctionconvert_doc_to_tensors
Converts `Doc` into tensors. This method is probably not the method you want to use because it returns tensors for the `Doc` only. Batch
src/refined/utilities/preprocessing_utils.py:214
↓ 1 callersFunctioncreate_class_to_idx
(chosen_classes_file: str)
src/refined/offline_data_generation/generate_qcode_to_type_indices.py:109
↓ 1 callersFunctioncreate_description_tensor
(output_path: str, qcode_to_idx_filename: str, desc_filename: str, label_filename: str,
src/refined/offline_data_generation/generate_descriptions_tensor.py:14
↓ 1 callersFunctioncreate_tensors
(resources_dir: str, additional_entities: Optional[List[AdditionalEntity]] = None, is_test:
src/refined/offline_data_generation/generate_qcode_to_type_indices.py:22
↓ 1 callersFunctiondefine_template
Adds a template defined in the :param page:. @see https://en.wikipedia.org/wiki/Help:Template#Noinclude.2C_includeonly.2C_and_onlyinclude
src/refined/offline_data_generation/wiki_extractor.py:1971
↓ 1 callersFunctiondownload_common_wikidata_classes
()
src/refined/offline_data_generation/class_selection.py:59
↓ 1 callersFunctiondownload_dumps
Concurrently download Wikidata text, Wikipedia redirects, Wikipedia page ids, Wikidata dumps
src/refined/offline_data_generation/preprocess_all.py:90
↓ 1 callersMethoddownload_models_if_needed
(self)
src/refined/resource_management/resource_manager.py:50
↓ 1 callersMethoddownload_training_files_if_needed
Additional files which includes files needed to run evaluation on datasets with Wikipedia titles.
src/refined/resource_management/resource_manager.py:77
↓ 1 callersFunctionent_good_classes
(entity: Dict[str, Any], pem, occupations, sports, country, instance_of, class_explorer, subclasses,
src/refined/offline_data_generation/class_selection.py:67
↓ 1 callersFunctionevaluate
( model, dev_dls, tokenizer, device: str, ner_tag_to_num: Dict[str, int] )
src/refined/training/train/train_md_standalone.py:380
↓ 1 callersFunctionevaluate
(evaluation_dataset_name_to_docs: Dict[str, Iterable[Doc]], refined: Refined, ed_thr
src/refined/evaluation/evaluation.py:310
↓ 1 callersFunctionevaluate_on_docs
( refined, docs: Iterable[Doc], progress_bar: bool = True, dataset_name: str =
src/refined/evaluation/evaluation.py:129
↓ 1 callersMethodexpandTemplate
Expands template invocation. :param body: the parts of a template. :see http://meta.wikimedia.org/wiki/Help:Expansion for an explanati
src/refined/offline_data_generation/wiki_extractor.py:947
↓ 1 callersFunctionextract_useful_info
(entity)
src/refined/offline_data_generation/process_wikidata_dump.py:10
↓ 1 callersFunctionfine_tune_on_docs
(refined: Refined, train_docs: Iterable[Doc], eval_docs: Iterable[Doc], fine_tuning_args
src/refined/training/fine_tune/fine_tune.py:194
↓ 1 callersMethodfrom_model_config_file
( cls, filename: str, entity_set: str, data_dir: str,
src/refined/doc_preprocessing/preprocessor.py:313
↓ 1 callersFunctiongather
r""" Taken from torch code with slight modification to allow Span return value from model forward pass.
src/refined/torch_overrides/data_parallel_refined.py:19
↓ 1 callersFunctiongather_map
(outputs)
src/refined/torch_overrides/data_parallel_refined.py:23
↓ 1 callersFunctiongenerate_redirects
(redirect_sql_gz_filepath: str, output_dir: str, page_id_to_title: Dict[str, str])
src/refined/offline_data_generation/process_wiki.py:90
↓ 1 callersFunctiongenerate_wiki_id_to_title
(page_sql_gz_filepath: str, output_dir: str)
src/refined/offline_data_generation/process_wiki.py:61
↓ 1 callersMethodget_accuracy
(self)
src/refined/evaluation/metrics.py:80
↓ 1 callersMethodget_ace2004_docs
( self, split: str, include_spans: bool = True, include_gold_l
src/refined/dataset_reading/entity_linking/dataset_factory.py:216
↓ 1 callersMethodget_aquaint_docs
( self, split: str, include_spans: bool = True, include_gold_l
src/refined/dataset_reading/entity_linking/dataset_factory.py:201
↓ 1 callersMethodget_batch_elements
(self)
src/refined/dataset_reading/mention_detection/webqsp_reader.py:84
↓ 1 callersMethodget_candidates
Given a surface form (e.g. "Donald Trump") the method will return the top k (MAX_CANDIDATES) based on P(e|m) lookup dictionary. The m
src/refined/doc_preprocessing/preprocessor.py:56
↓ 1 callersMethodget_classes_idx_for_qcode_batch
Retrieves all of the classes indices for the qcodes (from various relations used to construct the lookup). :param qcodes: qcodes
src/refined/doc_preprocessing/class_handler.py:124
↓ 1 callersMethodget_cweb_docs
( self, split: str, include_spans: bool = True, include_gold_l
src/refined/dataset_reading/entity_linking/dataset_factory.py:231
↓ 1 callersMethodget_dataset_files
(self)
src/refined/resource_management/resource_manager.py:165
↓ 1 callersMethodget_doc_format
Check if the date gives away whether dates in this document are UK style (day/month/year) or US style (month/day/year) :retu
src/refined/utilities/numeric_handling/date_utils.py:51
↓ 1 callersMethodget_f1_md
(self)
src/refined/evaluation/metrics.py:74
↓ 1 callersMethodget_gold_recall
(self)
src/refined/evaluation/metrics.py:83
↓ 1 callersMethodget_model_files
(self)
src/refined/resource_management/resource_manager.py:173
↓ 1 callersMethodget_ner_tag
(self, ner: str, in_ent: bool)
src/refined/dataset_reading/mention_detection/webqsp_reader.py:123
↓ 1 callersMethodget_parameters_to_scale
Gets parameters that can be scaled during training. Usually top/last layers. :return: list of parameters
src/refined/model_components/refined_model.py:112
↓ 1 callersFunctionget_standard_datasets
(datasets: Datasets, el: bool, filter_not_in_kb: bool = Tr
src/refined/evaluation/evaluation.py:189
↓ 1 callersMethodget_summary
(self)
src/refined/evaluation/metrics.py:38
← previousnext →101–200 of 427, ranked by callers