Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/amazon-science/ReFinED
/ functions
Functions
427 in github.com/amazon-science/ReFinED
⨍
Functions
427
◇
Types & classes
58
Method
__init__
Constructs PreprocessorInferenceOnly object. :param data_dir: path to directory containing the resources files :param max_can
src/refined/doc_preprocessing/preprocessor.py:120
Method
__init__
(self, resource_manager: ResourceManager)
src/refined/doc_preprocessing/wikidata_mapper.py:9
Method
__init__
(self, max_candidates: int, pem: Mapping[str, List[Tuple[str, float]]], human_qcodes: Set[str])
src/refined/doc_preprocessing/candidate_generator.py:32
Method
__init__
(self, subclasses, index_to_class, qcode_idx_to_class_idx, qcode_to_idx)
src/refined/doc_preprocessing/class_handler.py:9
Method
__init__
Constructs model for NER and ED. :param config: the config for the model :param preprocessor: preprocessor :param use
src/refined/model_components/refined_model.py:32
Method
__init__
Based on transformer's BertForTokenClassification class. Token :param num_labels: number of labels used for token :param drop
src/refined/model_components/mention_detection_layer.py:14
Method
__init__
( self, dropout: float, num_classes: int, ignore_descriptions: bool = False,
src/refined/model_components/entity_disambiguation_layer.py:10
Method
__init__
(self, dropout: float, num_classes: int, encoder_hidden_size: int)
src/refined/model_components/entity_typing_layer.py:8
Method
__init__
( self, preprocessor: Preprocessor, n_layer: int = 2, transformer_name: str =
src/refined/model_components/description_encoder.py:13
Method
__init__
( self, preprocessor: Preprocessor, mention_dim=768, output_dim=300, h
src/refined/model_components/ed_layer_2.py:12
Method
__init__
(self, **kwargs)
src/refined/offline_data_generation/wiki_extractor.py:84
Method
__init__
:param parameter: the parts of a tplarg.
src/refined/offline_data_generation/wiki_extractor.py:461
Method
__init__
(self, title='', args=[], prev=None)
src/refined/offline_data_generation/wiki_extractor.py:510
Method
__init__
:param id: id of page. :param title: tutle of page. :param lines: a list of lines.
src/refined/offline_data_generation/wiki_extractor.py:542
Method
__init__
(self)
src/refined/offline_data_generation/wiki_extractor.py:1626
Method
__init__
(self, function)
src/refined/offline_data_generation/wiki_extractor.py:1734
Method
__init__
(self, path_name)
src/refined/offline_data_generation/wiki_extractor.py:2665
Method
__init__
:param nextFile: a NextFile object from which to obtain filenames to use. :param max_file_size: the maximum size of each
src/refined/offline_data_generation/wiki_extractor.py:2695
Method
__iter__
Iterates over the batch elements in each file. Each worker has a different set of files to process. Files contain ~ 1000 batc
src/refined/dataset_reading/entity_linking/wikipedia_dataset.py:98
Method
__iter__
(self)
src/refined/dataset_reading/entity_linking/document_dataset.py:134
Method
__iter__
(self)
src/refined/resource_management/lmdb_wrapper.py:18
Method
__len__
(self)
src/refined/dataset_reading/mention_detection/webqsp_reader.py:170
Method
__len__
(self)
src/refined/dataset_reading/mention_detection/conll_reader.py:251
Method
__len__
(self)
src/refined/dataset_reading/mention_detection/ontonotes_reader.py:175
Method
__len__
(self)
src/refined/dataset_reading/entity_linking/wikipedia_dataset.py:222
Method
__len__
Returns number of batch elements. :return: Number of batch elements.
src/refined/dataset_reading/entity_linking/document_dataset.py:73
Method
__len__
Returns number of batch elements. :return: Number of batch elements.
src/refined/dataset_reading/entity_linking/document_dataset.py:172
Method
__len__
(self)
src/refined/resource_management/lmdb_wrapper.py:39
Method
__next__
(self)
src/refined/offline_data_generation/wiki_extractor.py:2670
Method
__or__
(self, other)
src/refined/offline_data_generation/wiki_extractor.py:1740
Method
__post_init__
(self)
src/refined/utilities/numeric_handling/date_utils.py:23
Method
__post_init__
(self)
src/refined/data_types/base_types.py:69
Method
__post_init__
(self)
src/refined/data_types/doc_types.py:34
Method
__post_init__
(self)
src/refined/data_types/modelling_types.py:133
Method
__post_init__
(self)
src/refined/model_components/config.py:62
Method
__repr__
(self)
src/refined/inference/standalone_md.py:25
Method
__repr__
(self)
src/refined/data_types/base_types.py:73
Method
__repr__
(self)
src/refined/data_types/base_types.py:115
Method
__repr__
(self)
src/refined/offline_data_generation/wiki_extractor.py:86
Method
__rlshift__
(self, other)
src/refined/offline_data_generation/wiki_extractor.py:1743
Method
__ror__
(self, other)
src/refined/offline_data_generation/wiki_extractor.py:1737
Method
__rshift__
(self, other)
src/refined/offline_data_generation/wiki_extractor.py:1746
Method
__setitem__
(self, name, value)
src/refined/offline_data_generation/wiki_extractor.py:1632
Method
__str__
(self)
src/refined/offline_data_generation/wiki_extractor.py:443
Method
__str__
(self)
src/refined/offline_data_generation/wiki_extractor.py:481
Method
__str__
(self)
src/refined/offline_data_generation/wiki_extractor.py:525
Method
_init_weights
Initialize the weights.
src/refined/model_components/refined_model.py:154
Method
_init_weights
Initialize the weights.
src/refined/model_components/mention_detection_layer.py:31
Method
_init_weights
Initialize the weights.
src/refined/model_components/entity_disambiguation_layer.py:28
Method
_init_weights
Initialize the weights.
src/refined/model_components/entity_typing_layer.py:18
Method
_init_weights
Initialize the weights.
src/refined/model_components/description_encoder.py:58
Method
_init_weights
Initialize the weights.
src/refined/model_components/ed_layer_2.py:138
Method
add_candidates_to_spans
( self, spans: List[Span], backward_coref: bool = False, perso
src/refined/doc_preprocessing/preprocessor.py:300
Method
add_candidates_to_spans
Add candidate entities to spans in-place. Can return any object to maintain state.
src/refined/doc_preprocessing/candidate_generator.py:23
Method
add_candidates_to_spans
Add candidate entities to spans :param spans: list of spans :param backward_coref: if true will do 2 passes over spans (first
src/refined/doc_preprocessing/candidate_generator.py:123
Method
can_identify_format
(self)
src/refined/data_types/base_types.py:27
Method
class_check_spans
Modifies spans in-place. Checks the predicted fine-grained entity type and type of the predicted entity match. @param self: s
src/refined/doc_preprocessing/preprocessor.py:351
Function
collate
(items: List[Tuple[Tensor, Tensor]])
src/refined/utilities/md_dataset_utils.py:17
Method
collate
Collates a list of tensors for batch elements into a single batch. - Pads tensors to the longest length in batch - Corrects m
src/refined/dataset_reading/entity_linking/document_dataset.py:179
Function
create_qcode_to_idx
(pem_file: str, is_test: bool)
src/refined/offline_data_generation/generate_qcode_to_type_indices.py:98
Function
create_qcode_to_idx
(pem_file: str, is_test: bool)
src/refined/offline_data_generation/preprocess_all.py:101
Function
cycle
(iterable)
src/refined/utilities/general_utils.py:70
Function
download_common_wikidata_classes
()
src/refined/offline_data_generation/preprocessing_utils.py:76
Function
download_common_wikidata_classes
()
src/refined/offline_data_generation/fetch_coarse_classes.py:45
Function
download_dumps_in_parallel
Concurrently download Wikidata text, Wikipedia redirects, Wikipedia page ids, Wikidata dumps
src/refined/offline_data_generation/preprocess_all.py:69
Function
extract_process
Pull tuples of raw page content, do CPU/regex-heavy fixup, push finished text :param i: process id. :param jobs_queue: where to get jobs.
src/refined/offline_data_generation/wiki_extractor.py:3001
Method
finalize_options
Post-process options.
package.py:25
Function
fixup
(m)
src/refined/offline_data_generation/wiki_extractor.py:332
Method
forward
(self, *inputs, **kwargs)
src/refined/torch_overrides/data_parallel_refined.py:64
Method
forward
Full forward pass including transformer, MD, ET, ED layers. :param batch: BatchedElementsTns is a named tuple containg all the tensor
src/refined/model_components/refined_model.py:164
Method
forward
Forward pass of Mention Detection layer. Treated as token classification problem where each token is assigned a BIO label. B
src/refined/model_components/mention_detection_layer.py:39
Method
forward
Forward pass of ED layer. Scores candidate entities. :param class_activations: predicted classes for each mention span. shape
src/refined/model_components/entity_disambiguation_layer.py:36
Method
forward
Forward pass of Entity Typing layer. Averages the encoder's contextualised token embeddings for each mention span. :param men
src/refined/model_components/entity_typing_layer.py:26
Method
forward
Forward pass :param input_ids: input ids shape = (num_ents, max_cands, 32) 32 = description length, (descriptions) :return:
src/refined/model_components/description_encoder.py:66
Method
forward
( self, mention_embeddings: Tensor, candidate_desc: Tensor, candidate_entity_t
src/refined/model_components/ed_layer_2.py:61
Method
from_file
(cls, filepath: str)
src/refined/training/fine_tune/fine_tune_args.py:62
Method
from_file
(cls, filepath: str)
src/refined/training/train/training_args.py:78
Method
from_pretrained
Load a pretrained model. :param model_file: path to model file :param model_config_file: path to model config file :p
src/refined/model_components/refined_model.py:603
Method
gather
(self, outputs, output_device)
src/refined/torch_overrides/data_parallel_refined.py:48
Method
get_candidates
(self, *args, **kwargs)
src/refined/doc_preprocessing/preprocessor.py:297
Method
get_candidates
Generates a list of candidate entities (IDs) along with initial/prior scores. The :return: Returns a tuple. First item is a l
src/refined/doc_preprocessing/candidate_generator.py:13
Method
get_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/preprocessor.py:249
Method
get_doc_format
(self)
src/refined/data_types/base_types.py:42
Method
get_final_ed_params
(self)
src/refined/model_components/refined_model.py:138
Method
get_kg_params
(self)
src/refined/model_components/refined_model.py:135
Method
get_parameters_not_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:141
Method
get_parameters_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:34
Method
get_transformer_model
(self)
src/refined/resource_management/data_lookups.py:91
Method
get_transformer_model
(self)
src/refined/doc_preprocessing/preprocessor.py:363
Method
get_webqsp_docs
( self, split: str, include_spans: bool = True, include_gold_l
src/refined/dataset_reading/entity_linking/dataset_factory.py:261
Function
gold_bio_to_spans
(text, ners)
src/refined/utilities/dataset_utils.py:68
Function
handle_unicode
(entity)
src/refined/offline_data_generation/wiki_extractor.py:2648
Function
if_empty
This implements If_empty from English Wikipedia module: <title>Module:If empty</title> <ns>828</ns> <text>local p = {} f
src/refined/offline_data_generation/wiki_extractor.py:1342
Method
initialize_options
Set default values for options.
package.py:21
Function
inner
(bytes_amount: int)
src/refined/resource_management/aws.py:11
Function
normalizeTitle
Normalize title
src/refined/offline_data_generation/wiki_extractor.py:287
Method
process_text
(self, text: str)
src/refined/inference/standalone_md.py:70
Method
prune_classes
(self, class_ids: FrozenSet[str])
src/refined/doc_preprocessing/preprocessor.py:360
Function
reduce_process
Pull finished article text, write series of files (or stdout) :param opts: global parameters. :param output_queue: text to be output. :par
src/refined/offline_data_generation/wiki_extractor.py:3039
Function
roman_main
Convert first arg to roman numeral if <= 5000 else :return: second arg.
src/refined/offline_data_generation/wiki_extractor.py:1481
← previous
next →
301–400 of 427, ranked by callers