TREC(6) Question Classifier


Classify open-domain, fact-based questions into sub categories of the following broad semantic categories: Abbreviation, Description, Entities, Human Beings, Locations or Numeric Values.

Predicted Entities

ENTY_animal, ENTY_body, ENTY_color, ENTY_cremat, ENTY_currency, ENTY_dismed, ENTY_event, ENTY_food, ENTY_instru, ENTY_lang, ENTY_letter, ENTY_other, ENTY_plant, ENTY_product, ENTY_religion, ENTY_sport, ENTY_substance, ENTY_symbol, ENTY_techmeth, ENTY_termeq, ENTY_veh, ENTY_word, DESC_def, DESC_desc, DESC_manner, DESC_reason, HUM_gr, HUM_ind, HUM_title, HUM_desc, LOC_city, LOC_country, LOC_mount, LOC_other, LOC_state, NUM_code, NUM_count, NUM_date, NUM_dist, NUM_money, NUM_ord, NUM_other, NUM_period, NUM_perc, NUM_speed, NUM_temp, NUM_volsize, NUM_weight, ABBR_abb, ABBR_exp

Live Demo
Open in Colab

How to use

documentAssembler = DocumentAssembler()\

use = UniversalSentenceEncoder.pretrained(lang="en") \

document_classifier = ClassifierDLModel.pretrained('classifierdl_use_trec50', 'en') \
  .setInputCols(["document", "sentence_embeddings"]) \

nlpPipeline = Pipeline(stages=[documentAssembler, use, document_classifier])

light_pipeline = LightPipeline([['']]).toDF("text")))

annotations = light_pipeline.fullAnnotate('When did the construction of stone circles begin in the UK?')


+————————————————————————————————+————+ |document |class | +————————————————————————————————+————+ |When did the construction of stone circles begin in the UK? | NUM_date | +————————————————————————————————+————+

Model Information

Model Name classifierdl_use_trec50
Model Class ClassifierDLModel
Spark Compatibility 2.5.0
Spark NLP Compatibility 2.4
License open source
Edition public
Input Labels [document, sentence_embeddings]
Output Labels [class]
Language en
Upstream Dependencies with tfhub_use

Data Source

This model is trained on the 50 class version of TREC dataset.