https://github.com/murungaowen/python-vector-search
semantic search and vector search using pymongo, mongodb and hugging face
https://github.com/murungaowen/python-vector-search
Last synced: 2 months ago
JSON representation
semantic search and vector search using pymongo, mongodb and hugging face
- Host: GitHub
- URL: https://github.com/murungaowen/python-vector-search
- Owner: MurungaOwen
- Created: 2024-08-28T18:41:35.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-09-04T09:08:46.000Z (about 1 year ago)
- Last Synced: 2025-03-14T22:15:46.972Z (7 months ago)
- Language: Python
- Size: 93.8 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
---
title: vector-search-hood
app_file: main.py
sdk: gradio
sdk_version: 4.42.0
---
## vector search using hugging face semantic search, MongoDb and python
### setup
```bash
pip install -r requirements.txt
```#### create an account in hugging face and get acces token to store in .env file
#### Go to mongo db Atlas and setup the database and copy the mongo uri
### add search vector and edit in json in mongo search
```json
{
"mappings": {
"dynamic": true,
"fields": {
"plot_embedding": {
"dimensions": 384, //dimension gotten from size of array of the embedding from hugging face
"similarity": "dotProduct",
"type": "knnVector"
}
}
}
}
```### Run
run the functions as follows
```bash
python main.py
```
