HermannKroll / NarrativeIntelligence

GNU General Public License v3.0
4 stars 0 forks source link

Narrative Service: Rework Query Engine & Provenance feature #294

Open ir0ntr0nik opened 4 weeks ago

ir0ntr0nik commented 4 weeks ago

The idea is to replace the current provenance retrieval based on precomputed predications with the computation at runtime. The following things have to be modified:

  1. Change the current route of getting provenance information to the runtime variant. (and expect equal results)
  2. Reduce the complexity of the PredicationInvertedIndex
  3. Adjust the query engine (query_inverted_index_for_fact_pattern & process_query_with_expansion)
  4. Add a utility module that provides efficient joins (1) and intersections (2) of two lists of integers (as doc_ids)
ir0ntr0nik commented 1 week ago

SQL statement to rename the column provenance_mapping to document_ids:

ALTER TABLE predication_inverted_index
RENAME COLUMN provenance_mapping TO document_ids

Example for a document_ids entry: [id_1, id_2, id_3, ..., id_n] (list stored as a string, ids are always integers)

ir0ntr0nik commented 1 week ago

python compute_reverse_index_predication.py sidenotes:

HermannKroll commented 1 week ago

Solved.

HermannKroll commented 1 week ago

Can we improve the error shown to users when explanation has failed? For instance, "Explanation failed - please try again"

HermannKroll commented 1 day ago

Sort by confidence descending (in frontend)