Spaces:
Runtime error
Runtime error
File size: 1,272 Bytes
9c8703c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
from backend.survey import SurveyResponse, Preferences
from backend.query_rewritter import *
from backend.classes import *
from backend.retriever import DefaultRetriever
def main():
# Example usage of the SurveyResponse class
response = SurveyResponse(
major="Computer Science",
age_group="18-24",
class_subject="Introduction to AI",
exhibits=["Exhibit A", "Exhibit B"],
tour_length_minutes=60,
time_period=["qing"],
materiality=["cermanics"],
themes=[],
additional_interests=["auspicious symbolism"],
region=["east asia"],
colour=["iron"],
purpose=[""],
additional_notes=["rare artifacts"]
)
preferences = Preferences(
exhibits=response.exhibits,
time_period=response.time_period,
materiality=response.materiality,
region=response.region,
colour=response.colour,
purpose=response.purpose,
themes=response.themes,
additional_interests=response.additional_interests
)
query = generate_human_query(preferences)
retriever = DefaultRetriever()
results = retriever._retrieve_with_text(query, preferences, k=5)
print(results)
if __name__ == "__main__":
main()
|