Commit 6ed827f0 authored by Kantz's avatar Kantz
Browse files

box_hint entfernt

parent 051b1b00
......@@ -64,4 +64,4 @@ Retrieval settings:
## Testing
python -m test.hint_test ...
pyhton -m test.vector_store_test ...
\ No newline at end of file
python -m test.vector_store_test --query "Was ist eine Teilmenge?" --k 8 --expand
......@@ -131,7 +131,6 @@ CREATE TABLE IF NOT EXISTS docs (
subsection_title TEXT NULL,
title TEXT NULL,
type TEXT NULL,
box_hint TEXT NULL,
path TEXT NOT NULL,
markdown TEXT NOT NULL,
......@@ -152,12 +151,12 @@ UPSERT_SQL = """
INSERT INTO docs (
uid, doc_type,
section_index, subsection_index, child_index,
section_title, subsection_title, title, type, box_hint,
section_title, subsection_title, title, type,
path, markdown, embedding
) VALUES (
%(uid)s, %(doc_type)s,
%(section_index)s, %(subsection_index)s, %(child_index)s,
%(section_title)s, %(subsection_title)s, %(title)s, %(type)s, %(box_hint)s,
%(section_title)s, %(subsection_title)s, %(title)s, %(type)s,
%(path)s, %(markdown)s, %(embedding)s
)
ON CONFLICT (uid) DO UPDATE SET
......@@ -169,7 +168,6 @@ ON CONFLICT (uid) DO UPDATE SET
subsection_title = EXCLUDED.subsection_title,
title = EXCLUDED.title,
type = EXCLUDED.type,
box_hint = EXCLUDED.box_hint,
path = EXCLUDED.path,
markdown = EXCLUDED.markdown,
embedding = EXCLUDED.embedding
......@@ -213,7 +211,6 @@ def upsert_docs(pg_url: str, docs: List[DocRecord], embeddings: List[List[float]
"subsection_title": m.get("subsection_title"),
"title": m.get("title"),
"type": m.get("type"),
"box_hint": m.get("box_hint"),
"path": doc.path,
"markdown": doc.markdown,
"embedding": Vector(emb),
......@@ -294,7 +291,6 @@ def _row_to_retrieved(row: Dict[str, Any]) -> Retrieved:
"subsection_title": row["subsection_title"],
"title": row["title"],
"type": row["type"],
"box_hint": row["box_hint"],
"path": row["path"],
}
return Retrieved(
......@@ -360,7 +356,7 @@ def retrieve(
SELECT
uid, doc_type,
section_index, subsection_index, child_index,
section_title, subsection_title, title, type, box_hint,
section_title, subsection_title, title, type,
path, markdown,
1 - (embedding <=> %(qvec)s) AS score
FROM docs
......@@ -402,7 +398,7 @@ def retrieve(
SELECT
d.uid, d.doc_type,
d.section_index, d.subsection_index, d.child_index,
d.section_title, d.subsection_title, d.title, d.type, d.box_hint,
d.section_title, d.subsection_title, d.title, d.type,
d.path, d.markdown,
1.0 AS score
FROM docs d
......@@ -419,7 +415,7 @@ def retrieve(
SELECT
uid, doc_type,
section_index, subsection_index, child_index,
section_title, subsection_title, title, type, box_hint,
section_title, subsection_title, title, type,
path, markdown,
1.0 AS score
FROM docs
......@@ -435,7 +431,7 @@ def retrieve(
SELECT
d.uid, d.doc_type,
d.section_index, d.subsection_index, d.child_index,
d.section_title, d.subsection_title, d.title, d.type, d.box_hint,
d.section_title, d.subsection_title, d.title, d.type,
d.path, d.markdown,
1 - (d.embedding <=> %(qvec)s) AS score
FROM docs d
......@@ -478,7 +474,7 @@ def retrieve(
SELECT
d.uid, d.doc_type,
d.section_index, d.subsection_index, d.child_index,
d.section_title, d.subsection_title, d.title, d.type, d.box_hint,
d.section_title, d.subsection_title, d.title, d.type,
d.path, d.markdown,
0.9 AS score
FROM docs d
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment