Skip to content
This repository was archived by the owner on Jul 28, 2025. It is now read-only.

Commit d58227b

Browse files
committed
RelCAT: flake8 fixes.
1 parent a7c0336 commit d58227b

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

medcat/utils/relation_extraction/ml_utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ def split_list_train_test_by_class(data: List, sample_limit: int = -1, test_size
2323
Args:
2424
data (List): "output_relations": relation_instances, <-- see create_base_relations_from_doc/csv
2525
for data columns
26+
sample_limit (int, optional): limit the number of samples per class, useful for dataset balancing . Defaults to -1.
2627
test_size (float): Defaults to 0.2.
2728
shuffle (bool): shuffle data randomly. Defaults to True.
2829

medcat/utils/relation_extraction/models.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ def __init__(self, pretrained_model_name_or_path: str, relcat_config: ConfigRelC
174174
this can be a HF model i.e: "bert-base-uncased", if left empty, it is normally assumed that a model is loaded from 'model.dat'
175175
using the RelCAT.load() method. So if you are initializing/training a model from scratch be sure to base it on some model.
176176
relcat_config (ConfigRelCAT): relcat config.
177-
model_config (BertConfig): HF bert config for model.
177+
model_config (ModernBertConfig): HF bert config for model.
178178
"""
179179
super(ModernBertModel_RelationExtraction, self).__init__()
180180

@@ -268,7 +268,6 @@ def output2logits(self, sequence_output: torch.Tensor, input_ids: torch.Tensor,
268268
"""
269269
270270
Args:
271-
pooled_output (torch.Tensor): embedding of the CLS token
272271
sequence_output (torch.Tensor): hidden states/embeddings for each token in the input text
273272
input_ids (torch.Tensor): input token ids.
274273
e1_e2_start (torch.Tensor): annotation tags token position

medcat/utils/relation_extraction/rel_dataset.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ def _create_relation_validation(self,
192192
ent2_start_char_pos (int): ent2 start char pos
193193
ent1_end_char_pos (int): ent1 end char pos
194194
ent2_end_char_pos (int): ent2 end char pos
195-
ent1_token_start_pos (int, optional): ent1_token_start_pos. Defaults to -1.
196-
ent2_token_start_pos (int, optional): ent2_token_start_pos. Defaults to -1.
195+
ent1_token_start_pos (int): ent1_token_start_pos. Defaults to -1.
196+
ent2_token_start_pos (int): ent2_token_start_pos. Defaults to -1.
197197
ent1_token_end_pos (int, optional): ent1_token_end_pos. Defaults to -1.
198198
ent2_token_end_pos (int, optional): ent2_token_end_pos. Defaults to -1.
199199
is_spacy_doc (bool, optional): checks if doc is spacy docs. Defaults to False.

0 commit comments

Comments
 (0)