TigreGotico/eat-classifiers
0
eat-classifiers
English question answer-type (EAT) classifiers trained on the TigreGotico/EAT dataset (30,017 questions, 53 fine-grained labels across 7 TREC categories).
Two-stage inference (eat7 gates eat53) achieves 93.4% macro F1 on the test set.
Used by little_questions.
Label taxonomy
7 main categories, 53 sub-types:
Models
Both punctuated and unpunctuated variants are provided. Use the unpunctuated (_unpunct) model for ASR / voice assistant input.
Two-stage inference
import onnxruntime as rt, numpy as np, json
sess7 = rt.InferenceSession("eat7_svm_cal_EN_0.9.0.onnx")
sess53 = rt.InferenceSession("eat53_svm_cal_EN_0.9.0.onnx")
classes7 = json.loads(sess7.get_modelmeta().custom_metadata_map["classes"])
classes53 = json.loads(sess53.get_modelmeta().custom_metadata_map["classes"])
main_of_53 = [c.split(":")[0] for c in classes53]
def classify(text):
inp = np.array([text], dtype=object)
main = classes7[int(sess7.run(None, {"input": inp})[0][0])]
_, probs = sess53.run(None, {"input": inp})
row = probs[0].copy()
for j, m in enumerate(main_of_53):
if m != main:
row[j] = 0.0
row /= row.sum()
return classes53[int(np.argmax(row))], float(row.max())
print(classify("Who invented the telephone?")) # ('HUM:ind', 0.96)Benchmarks
Full results: BENCHMARKS.md
