🌐 AI搜索 & 代理 主页
Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Updated javascript examples a bit
  • Loading branch information
SilasMarvin committed Aug 28, 2023
commit a8526814d469c109fe49bbb7ced530fe5086b5a3
4 changes: 2 additions & 2 deletions pgml-sdks/pgml/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Suported Languages

We support a number of different languages:
- [Python](/python)
- [JavaScript](/javascript)
- [Python](python)
- [JavaScript](javascript)
- Rust

Our SDK is written completely in Rust and translated by Rust to our other supported languages. See each individual language for an overview and specification on how to use the SDK.
Expand Down
19 changes: 13 additions & 6 deletions pgml-sdks/pgml/javascript/examples/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,23 @@
## Examples
# Examples

### [Semantic Search](./semantic_search.js)
## Prerequisites
Before running any examples first install dependencies and set the DATABASE_URL environment variable:
```
npm i
export DATABASE_URL={YOUR DATABASE URL}
```

## [Semantic Search](./semantic_search.js)
This is a basic example to perform semantic search on a collection of documents. Embeddings are created using `intfloat/e5-small` model. The results are semantically similar documemts to the query. Finally, the collection is archived.

### [Question Answering](./question_answering.js)
## [Question Answering](./question_answering.js)
This is an example to find documents relevant to a question from the collection of documents. The query is passed to vector search to retrieve documents that match closely in the embeddings space. A score is returned with each of the search result.

### [Question Answering using Instructore Model](./question_answering_instructor.js)
## [Question Answering using Instructore Model](./question_answering_instructor.js)
In this example, we will use `hknlp/instructor-base` model to build text embeddings instead of the default `intfloat/e5-small` model.

### [Extractive Question Answering](./extractive_question_answering.js)
## [Extractive Question Answering](./extractive_question_answering.js)
In this example, we will show how to use `vector_recall` result as a `context` to a HuggingFace question answering model. We will use `Builtins.transform()` to run the model on the database.

### [Summarizing Question Answering](./summarizing_question_answering.js)
## [Summarizing Question Answering](./summarizing_question_answering.js)
This is an example to find documents relevant to a question from the collection of documents and then summarize those documents.
12 changes: 0 additions & 12 deletions pgml-sdks/pgml/javascript/examples/getting-started/README.md

This file was deleted.

54 changes: 0 additions & 54 deletions pgml-sdks/pgml/javascript/examples/getting-started/index.js

This file was deleted.

15 changes: 0 additions & 15 deletions pgml-sdks/pgml/javascript/examples/getting-started/package.json

This file was deleted.