QueryZeroShotClassifier

class squirro.lib.nlp.apps.query_processing.QueryZeroShotClassifier(config)

Bases: squirro.lib.nlp.steps.batched_step.BatchedStep

Classify query into predefined classes using zero-shot-classification.

Parameters
  • step (str, "app") – app

  • type (str, "query_processing") – query_processing

  • name (str, "disambiguater") – disambiguater

  • input_field (str, "user_terms_str") – raw user query strings

  • model (str, "facebook/bart-large-mnli") – zero shot classification to use

  • target_facet (str) – Target facet to be used for classification

  • candidate_labels (list, []) – Target classes

  • output_field (str, "facet_mutations") – new facets filter to apply

  • confidence_threshold (float, 0.65) – Minimum confidence to apply detected facet filter to query

  • facet_names (dict,{}) – Lookup of candidate label to mapped facet name

  • path (str, ".") – path

Methods Summary

get_facet_name(label)

process_doc(**kw)

Process a document

Methods Documentation

get_facet_name(label)
process_doc(**kw)

Process a document

Parameters

doc (Document) – Document

Returns

Processed document

Return type

Document