Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit427f77f

Browse files
authored
Merge branch 'master' into silas-semantic-search-in-postgres-in-15-minutes
2 parents27445f5 +df32769 commit427f77f

File tree

57 files changed

+2272
-229
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+2272
-229
lines changed

‎.github/workflows/ubuntu-packages-and-docker-image.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
packageVersion:
7-
default:"2.8.2"
7+
default:"2.9.1"
88
jobs:
99
#
1010
# PostgresML extension.

‎pgml-cms/blog/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
*[Home](README.md)
44
*[Semantic Search in Postgres in 15 Minutes](semantic-search-in-postgres-in-15-minutes.md)
5+
*[Unified RAG](unified-rag.md)
56
*[Announcing the Release of our Rust SDK](announcing-the-release-of-our-rust-sdk.md)
67
*[Serverless LLMs are dead; Long live Serverless LLMs](serverless-llms-are-dead-long-live-serverless-llms.md)
78
*[Speeding up vector recall 5x with HNSW](speeding-up-vector-recall-5x-with-hnsw.md)

‎pgml-cms/blog/unified-rag.md

Lines changed: 535 additions & 0 deletions
Large diffs are not rendered by default.
Loading

‎pgml-cms/docs/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
*[Chatbots](guides/chatbots/README.md)
6464
*[Example Application](use-cases/chatbots.md)
6565
*[Supervised Learning](guides/supervised-learning.md)
66+
*[Unified RAG](guides/unified-rag.md)
6667
*[OpenSourceAI](guides/opensourceai.md)
6768
*[Natural Language Processing](guides/natural-language-processing.md)
6869

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
description:Rank documents against a piece of text using the specified ranking model.
3+
---
4+
5+
#pgml.rank()
6+
7+
The`pgml.rank()` function is used to compute a relevance score between documents and some text. This function is primarily used as the last step in a search system where the results returned from the initial search are re-ranked by relevance before being used.
8+
9+
##API
10+
11+
```postgresql
12+
pgml.rank(
13+
transformer TEXT, -- transformer name
14+
query TEXT, -- text to rank against
15+
documents TEXT[], -- documents to rank
16+
kwargs JSON -- optional arguments (see below)
17+
)
18+
```
19+
20+
##Example
21+
22+
Ranking documents is as simple as calling the the function with the documents you want to rank, and text you want to rank against:
23+
24+
```postgresql
25+
SELECT pgml.rank('mixedbread-ai/mxbai-rerank-base-v1', 'test', ARRAY['doc1', 'doc2']);
26+
```
27+
28+
By default the`pgml.rank()` function will return and rank all of the documents. The function can be configured to only return the relevance score and index of the top k documents by setting`return_documents` to`false` and`top_k` to the number of documents you want returned.
29+
30+
```postgresql
31+
SELECT pgml.rank('mixedbread-ai/mxbai-rerank-base-v1', 'test', ARRAY['doc1', 'doc2'], '{"return_documents": false, "top_k": 10}'::JSONB);
32+
```
33+
34+
##Supported ranking models
35+
36+
We currently support cross-encoders for re-ranking. Check out[Sentence Transformer's documentation](https://sbert.net/examples/applications/cross-encoder/README.html) for more information on how cross-encoders work.
37+
38+
By default we provide the following ranking models:
39+
40+
*`mixedbread-ai/mxbai-rerank-base-v1`

‎pgml-cms/docs/guides/supervised-learning.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ target |
4646

4747
###Training a Model
4848

49-
Now that we've got data, we're ready to train a model using an algorithm. We'll start withthe default`linear` algorithmto demonstrate the basics. Seethe[Algorithms](../../../docs/training/algorithm\_selection/) for a complete list of available algorithms.
49+
Now that we've got data, we're ready to train a model using an algorithm. We'll start witha classification taskto demonstrate the basics. See[pgml.train](/docs/api/sql-extension/pgml.train/) for a complete list of available algorithms and tasks.
5050

5151
```postgresql
5252
SELECT * FROM pgml.train(
@@ -79,7 +79,7 @@ INFO: Metrics: {
7979
(1 row)
8080
```
8181

82-
The output gives us information about the training run, including the`deployed` status. This is great news indicating training has successfully reached a new high score for the project's key metric and our new model was automatically deployed as the one that will be used to make new predictions for the project. See[Deployments](../../../docs/predictions/deployments/) for a guide to managing the active model.
82+
The output gives us information about the training run, including the`deployed` status. This is great news indicating training has successfully reached a new high score for the project's key metric and our new model was automatically deployed as the one that will be used to make new predictions for the project.
8383

8484
###Inspecting the results
8585

@@ -152,7 +152,7 @@ LIMIT 25;
152152

153153
###Example
154154

155-
If you'vealready been through the[Training Overview](../../../docs/training/overview/), you can see the results of those efforts:
155+
If you'veexecuted the commands in this guide, you can see the results of those efforts:
156156

157157
```postgresql
158158
SELECT
@@ -195,7 +195,7 @@ SELECT * FROM pgml.deployed_models;
195195

196196
PostgresML will automatically deploy a model only if it has better metrics than existing ones, so it's safe to experiment with different algorithms and hyperparameters.
197197

198-
Take a look at[Deploying Models](../../../docs/predictions/deployments/) documentation for more details.
198+
Take a look at[pgml.deploy](/docs/api/sql-extension/pgml.deploy) documentation for more details.
199199

200200
###Specific Models
201201

‎pgml-cms/docs/guides/unified-rag.md

Lines changed: 528 additions & 0 deletions
Large diffs are not rendered by default.

‎pgml-cms/docs/resources/developer-docs/contributing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ SELECT pgml.version();
127127
postgres=# select pgml.version();
128128
version
129129
-------------------
130-
2.7.4
130+
2.9.1
131131
(1 row)
132132
```
133133
{% endtab %}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp