An efficient and agile neural network intent parser


class padatious.IntentContainer(cache_dir)[source]

Creates an IntentContainer object used to load and match intents

Parameters:cache_dir (str) – Place to put all saved neural networks

Tests all the intents against the query and returns match data of the best intent

Parameters:query (str) – Input sentence to test against intents
Returns:Best intent match
Return type:MatchData

Tests all the intents against the query and returns data on how well each one matched against the query

Parameters:query (str) – Input sentence to test against intents
Returns:List of intent matches
Return type:list<MatchData>

See calc_intent() for a description of the returned MatchData

load_file(name, file_name, reload_cache=False)[source]

Loads an intent, optionally checking the cache first

  • name (str) – The associated name of the intent
  • file_name (str) – The location of the intent file
  • reload_cache (bool) – Whether to force regenerating all cache files rather than using them to load from
train(print_updates=True, single_thread=False)[source]

Trains all the loaded intents that need to be updated If a cache file exists with the same hash as the intent file, the intent will not be trained and just loaded from file

Parameters:print_updates (bool) – Whether to print a message to stdout each time a new intent is trained


class padatious.MatchData(name, sent, matches=None, conf=0.0)[source]

A set of data describing how a query fits into an intent


str – Name of matched intent


str – The query after entity extraction


float – Confidence (from 0.0 to 1.0)


dict of str -> str – Key is the name of the entity and value is the extracted part of the sentence