A simple demo showcasing semantic similarity for text search.
- Install Dependencies:
npm install- Run the Search Script:
./text-search.js <filename> "<query>"<filename>: The path to the text file you want to search. The file should contain one or more lines of text."<query>": The search query, enclosed in double quotes.
To find the most relevant lines in solar-system.txt related to "gas giants composition":
./text-search.js solar-system.txt "gas giants composition"This will output the top 3 most similar lines from solar-system.txt based on the provided query.