kasaysayan-check / test_model.py
FuzzyD1no's picture
Upload 15 files
85a2c74 verified
Raw History Blame Contribute Delete
671 Bytes
from transformers import pipeline
# Load your local trained model
try:
checker = pipeline("text-classification", model="./kasaysayan_bert_model", tokenizer="./kasaysayan_bert_model")
# Test cases
test_claims = [
"The economy grew by 5% in 1975 according to World Bank records.", # Should be 'Objective'
"DELUSIONAL CRITICS ARE HIDING THE TRUTH ABOUT THE GOLDEN AGE!!!", # Should be 'Troll/Suspicious'
]
for claim in test_claims:
result = checker(claim)
print(f"Claim: {claim}\nResult: {result}\n")
except Exception as e:
print(f"Error loading model: {e}. Did you finish running train_bert.py?")