Executors are classes that deterministically transform programs in domain specific languages into denotations. We have one executor defined for each language-domain pair that we handle.

class allennlp.semparse.executors.sql_executor.SqlExecutor(database_file: str)[source]

Bases: object

This class evaluates SQL queries by connecting to a SQLite database. Because SQLite is disk-based we just need to provide one file with the location. We execute the predicted SQL query and the labeled queries against the database and check if they execute to the same table.

evaluate_sql_query(self, predicted_sql_query: str, sql_query_labels: List[str]) → int[source]
static postprocess_query_sqlite(query: str)[source]