Add "Practice datasets" section (#199)

* Add common datasets

* Add instruction for titles

* Add tutorial on how to use Hugging Face datasets

* Add an information about Qdrant org at Hugging Face

* Add links to Hugging Face datasets

* Add preview images

* Add CTA (Discord)

* Fix typo

* Add link to Discord

* List available datasets on top of the page

* Fix some typos and improve intro

* Fix some typos and improve intro

* Add fixed snapshot links

* Add Wolt food dataset

* Add API calls to restore the snapshots

* Adjust the weight of the section

* Reorder tutorials
This commit is contained in:
Kacper Łukawski
2024-01-02 16:24:09 +01:00
committed by GitHub
parent f9867f6840
commit bc20106b7d
13 changed files with 357 additions and 101 deletions
@@ -214,16 +214,16 @@ class NeuralSearcher:
```python
def search(self, text: str):
search_result = self.qdrant_client.query(
collection_name=self.collection_name,
query_text=text,
query_filter=None, # If you don't want any filters for now
limit=5 # 5 the most closest results is enough
)
# `search_result` contains found vector ids with similarity scores along with the stored payload
# In this function you are interested in payload only
metadata = [hit.metadata for hit in search_result]
return metadata
search_result = self.qdrant_client.query(
collection_name=self.collection_name,
query_text=text,
query_filter=None, # If you don't want any filters for now
limit=5, # 5 the closest results are enough
)
# `search_result` contains found vector ids with similarity scores along with the stored payload
# In this function you are interested in payload only
metadata = [hit.metadata for hit in search_result]
return metadata
```
3. Add search filters.
@@ -286,17 +286,17 @@ from neural_searcher import NeuralSearcher
app = FastAPI()
# Create a neural searcher instance
neural_searcher = NeuralSearcher(collection_name='startups')
neural_searcher = NeuralSearcher(collection_name="startups")
@app.get("/api/search")
def search_startup(q: str):
return {
"result": neural_searcher.search(text=q)
}
return {"result": neural_searcher.search(text=q)}
if __name__ == "__main__":
import uvicorn
uvicorn.run(app, host="0.0.0.0", port=8000)
```