How swagath18/semanticfoodsearch works
Main components
• User Query Interface: Though not explicitly a web front-end, the “user query” serves as the input prompt for the system.
• Query Embedding Module: This component uses embedding algorithms (baseline from test1 and an alternative from test2) to convert the textual query into a vector representation.
• Data Ingestion/Preparation: The CSV file (menu_items.csv) is read and processed; each menu item would be converted to vector embeddings to be stored.
• Vector Database: The vectorized representations of the menus are stored here; this component supports similarity search operations.
• Search Engine/Matching Component: This takes the query’s embedding, runs a similarity search against the vector database and retrieves matching restaurant menus.
• Result Formatting & Output: The matched items are then formatted and returned to the user.
Their relationships and interactions
• The process starts when a user submits a query.
• The Query Embedding Module then transforms the query into a vector.
• The Search Engine uses this vector to search in the Vector Database (which was populated earlier by processing the CSV file via an embedding mechanism).
• The matched results (restaurant menu items/entries) are fetched and returned through the Result Formatting component back to the user.
• In tests (as seen in test.ipynb versus test2.ipynb), different embedding methods are compared to improve result quality.
Architectural patterns/design principles
• Data Pipeline Concept: The system follows a clear pipeline—ingest data → preprocess/encode → store in database → query transform → similarity search.
• Modularity: The notebook experiments suggest modular development where different embedding strategies can be swapped (or compared) with minimal changes.
• Separation of Concerns: Even though the project is compact, the responsibilities are separated between data preprocessing (CSV handling), embedding generation, and query matching.
Relevant technologies/frameworks/libraries
• Embedding Generation: Likely using Sentence Transformers (as mentioned in the README), with an alternative embedding method tested in test2.
• Data Handling: CSV file handling for menu items.
• Experimentation/Prototyping: Jupyter Notebooks indicate a research/prototype stage.
Recommended elements
• Use clear labels for each component: “User Query Input”, “Query Embedding Module”, “Data Preprocessing (CSV Ingestion)”, “Vector Embedding Store”, “Similarity Search Engine”, and “Result Output”.
• Input components (e.g., user query) vs. computation (embedding modules) vs. storage (vector database) vs. output (result display).