Skip to content

Commit

Permalink
Merge pull request #1539 from vespa-engine/andreer/summaries
Browse files Browse the repository at this point in the history
andreer/summaries
  • Loading branch information
thomasht86 authored Oct 25, 2024
2 parents d87a260 + 1792cb3 commit 32ed627
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 1 addition & 3 deletions visual-retrieval-colpali/backend/vespa_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,12 +318,12 @@ async def get_suggestions(self, query: str) -> list:
async with self.app.asyncio(connections=1) as session:
start = time.perf_counter()
yql = f'select questions from {self.VESPA_SCHEMA_NAME} where questions matches "{query}" limit 3'
print(yql)
response: VespaQueryResponse = await session.query(
body={
"yql": yql,
"ranking": "unranked",
"presentation.timing": True,
"presentation.summary": "suggestions",
},
)
assert response.is_successful(), response.json
Expand All @@ -337,8 +337,6 @@ async def get_suggestions(self, query: str) -> list:
if "root" in response.json and "children" in response.json["root"]
else []
)
print(response.json)

questions = [
result["fields"]["questions"]
for result in search_results
Expand Down
9 changes: 9 additions & 0 deletions visual-retrieval-colpali/prepare_feed_deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,15 @@ def float_to_binary_embedding(float_query_embedding: dict) -> dict:
],
from_disk=True,
),
DocumentSummary(
name="suggestions",
summary_fields=[
Summary(
name="questions"
),
],
from_disk=True,
),
],
)

Expand Down

0 comments on commit 32ed627

Please sign in to comment.