Commit 4aacb197 authored by Aneeb Imamdin's avatar Aneeb Imamdin

Readme updated

parent acf93257
# Project Title
# Vector Search
This project performs vector search using Python and Google Cloud services like BigQuery. Follow the steps below to set up the environment, install dependencies, and authenticate with Google Cloud.
......@@ -24,6 +24,68 @@ Once the SDK is installed, authenticate with your Google Cloud account by runnin
gcloud auth login
```
## Create Table in BigQuery
This document provides the steps to create a table in Google BigQuery with the following specifications:
- **Table Name**: `your_table_name`
- **Columns**:
- `bpnId`: STRING (TEXT)
- `embeddings`: FLOAT64 (REPEATED)
- `text`: STRING (NOT NULL)
## Prerequisites
- Google Cloud account
- Access to BigQuery
- `gcloud` command-line tool installed and configured (optional)
## Steps to Create the Table
1. **Open BigQuery**:
- Go to the [Google Cloud Console](https://console.cloud.google.com/).
- Navigate to the BigQuery section.
2. **Select Dataset**:
- In the left panel, select your project.
- Click on the dataset where you want to create the table. If you don't have a dataset, create one by clicking on the project name and then "Create Dataset."
3. **Create Table**:
- Click on the dataset name.
- Click on "Create Table."
4. **Configure Table Settings**:
- **Source**: Select "Empty table."
- **Table Name**: Enter your desired table name (e.g., `your_table_name`).
- **Schema**: Define the schema as follows:
- Click on "Add field" to add the first column:
- **Field name**: `bpnId`
- **Type**: STRING
- **Mode**: REQUIRED
- Click on "Add field" to add the second column:
- **Field name**: `embeddings`
- **Type**: FLOAT
- **Mode**: REPEATED
- Click on "Add field" to add the third column:
- **Field name**: `text`
- **Type**: STRING
- **Mode**: REQUIRED
5. **Create the Table**:
- After filling in the details, click on the "Create table" button at the bottom of the page.
## Example SQL Command
You can also create the table using a SQL command in the BigQuery console or through the `bq` command-line tool. Here’s an example:
```sql
CREATE TABLE `your_project_id.your_dataset_id.your_table_name` (
bpnId STRING NOT NULL,
embeddings FLOAT64 REPEATED,
text STRING NOT NULL
);
```
### Run the project
- Create Virtual Environment
......@@ -68,6 +130,7 @@ http://127.0.0.1:5000/vector-search?query=Test Query
### NOTES
- Make sure to replace the placeholders with exact value.
- Data.docx file is already present in the code.
- If You want to change the data you are free to replace the content of the file.
- We are taking every paragraph and generating its embeddings, You are free to change this logic and define your preferred chunk size.
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment