Skip to content
Snippets Groups Projects
Commit e127947b authored by Thomas Wolf's avatar Thomas Wolf
Browse files

- Pushed logs from NEC test runs

- Naming corrections for consistency, comments, removed superfluous files
parent 51e06d32
No related branches found
No related tags found
No related merge requests found
Showing
with 6011 additions and 24009 deletions
......@@ -118,4 +118,4 @@ train.json
logs
# evaluation output
results
#results
......@@ -96,7 +96,7 @@ def get_annotated_sentences():
for ent in entities:
annotations.append((ent, entity_type))
except json.JSONDecodeError:
# If parsing fails, we can skip or log the error.
# If parsing fails, skip the error.
pass
i += 2 # Skip the GPT answer
else:
......
......@@ -2,7 +2,7 @@
Provides functions for probing / NER that can be called with model name and the required data.
Makes evaluating models easier.
"""
from src.models.llms_interface import available_models as llms
from src.models.LLM_interface import available_models as llms
from src.models.GLiNER import find_entities as find_entities_gliner
from src.models.GLiNER import classify_entity as classify_entity_gliner
from src.models.T5_NLI import classify_entity as classify_entity_t5_nli
......
......@@ -27,7 +27,7 @@ def run_NEC_tests(model_name, dataset, results_dir, test_instances=10):
labels = data_manager.get_labels(dataset)
data = data_manager.get_annotated_sentences(dataset, test_instances)
if (model_name == "Word2Vec" or model_name == "T5-MLM-entity"):
if model_name == "Word2Vec" or model_name == "T5-MLM-entity":
label_dict = data_manager.get_label_dict(dataset, test_instances)
print(label_dict)
set_label_dict(model_name, label_dict)
......@@ -58,7 +58,7 @@ def run_NEC_tests(model_name, dataset, results_dir, test_instances=10):
def run_NEC_tests_all():
models = ["GLiNER", "Llama-3.1-8B", "T5-NLI", "T5-MLM-label", "T5-MLM-entity", "Word2Vec", "DeepSeek-R1-Distill-Qwen-32B"]
models = ["DeepSeek-R1-Distill-Qwen-32B"] # "GLiNER", "Llama-3.1-8B", "T5-NLI", "T5-MLM-label", "T5-MLM-entity", "Word2Vec"
datasets = ["CoNLL", "FIGER-coarse", "FIGER-fine"] # "Pile-NER-type"]
for model in models:
for dataset in datasets:
......@@ -97,5 +97,5 @@ def read_NEC_metrics(directory):
print(f"Model: {model}, Dataset: {dataset}, Accuracy: {avg_accuracy:.2f}%")
run_NEC_tests_all()
#run_NEC_tests_all()
read_NEC_metrics("results")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment