Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update kg_ontologies.md #510

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/articles/kg_ontologies.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ node_embedding = openai.Embedding.create(input = row.desc, model=model) ['data']

**Build a vector store**

```markdown
```python
# Store the generated embedding vectors in a dedicated vector store:

index = faiss.IndexFlatL2(len(embedding))
Expand All @@ -94,7 +94,7 @@ index.add(embedding)

**Query with natural language**

```markdown
```python
# When a user poses a question in natural language, convert the query into an embedding vector using the same language model. Then, leverage the vector store to find the nodes with the lowest cosine similarity to the query vector:

question_embedding = openai.Embedding.create(input = question, model=model) ['data'][0]['embedding']
Expand All @@ -103,7 +103,7 @@ d, i = index.search(question_embedding, 100)

**Semantic post-processing**

```markdown
```python
# To further enhance the user experience, apply post-processing techniques to the retrieved related nodes. This step refines the results and presents information in a way that best provides users with actionable insights.
```

Expand Down