Skip to content

Commit 66f3844

Browse files
committed
valid urls
1 parent 268d37d commit 66f3844

File tree

7 files changed

+28
-37
lines changed

7 files changed

+28
-37
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,7 +1105,7 @@ pgml: SELECT logs->>'epoch' AS epoch, logs->>'step' AS step, logs->>'loss' AS lo
11051105
During training, model is periodically uploaded to Hugging Face Hub. You will find the model at `https://huggingface.co/<username>/<project_name>`. An example model that was automatically pushed to Hugging Face Hub is [here](https://huggingface.co/santiadavani/imdb_review_sentiement).
11061106

11071107
### 6. Inference using fine-tuned model
1108-
Now, that we have fine-tuned model on Hugging Face Hub, we can use [`pgml.transform`](/docs/open-source/pgml/guides/llms/text-classification) to perform real-time predictions as well as batch predictions.
1108+
Now, that we have fine-tuned model on Hugging Face Hub, we can use [`pgml.transform`](/docs/open-source/pgml/api/pgml.transform) to perform real-time predictions as well as batch predictions.
11091109

11101110
**Real-time predictions**
11111111

pgml-cms/blog/sentiment-analysis-using-express-js-and-postgresml.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Express is a mature JS backend framework touted as being fast and flexible. It i
2424

2525
Sentiment analysis is a valuable tool for understanding the emotional polarity of text. You can determine if the text is positive, negative, or neutral. Common use cases include understanding product reviews, survey questions, and social media posts.
2626

27-
In this application, we'll be applying sentiment analysis to note taking. Note taking and journaling can be an excellent practice for work efficiency and self improvement. However, if you are like me, it quickly becomes impossible to find and make use of anything I've written down. Notes that are useful must be easy to navigate. With this motivation, let's create a demo that can record notes throughout the day. Each day will have a summary and sentiment score. That way, if I'm looking for that time a few weeks ago when we were frustrated with our old MLOps platform — it will be easy to find.&#x20;
27+
In this application, we'll be applying sentiment analysis to note taking. Note taking and journaling can be an excellent practice for work efficiency and self improvement. However, if you are like me, it quickly becomes impossible to find and make use of anything I've written down. Notes that are useful must be easy to navigate. With this motivation, let's create a demo that can record notes throughout the day. Each day will have a summary and sentiment score. That way, if I'm looking for that time a few weeks ago when we were frustrated with our old MLOps platform — it will be easy to find.
2828

2929
We will perform all the Machine Learning heavy lifting with the pgml extension function `pgml.transform()`. This brings Hugging Face Transformers into our data layer.
3030

@@ -36,7 +36,7 @@ You can see the full code on [GitHub](https://github.com/postgresml/example-expr
3636

3737
This app is composed of three main parts, reading and writing to a database, performing sentiment analysis on entries, and creating a summary.
3838

39-
We are going to use [postgresql-client](https://www.npmjs.com/package/postgresql-client) to connect to our DB.&#x20;
39+
We are going to use [postgresql-client](https://www.npmjs.com/package/postgresql-client) to connect to our DB.
4040

4141
When the application builds we ensure we have two tables, one for notes and one for the the daily summary and sentiment score.
4242

@@ -62,7 +62,7 @@ const day = await connection.execute(`
6262

6363
We also have three endpoints to hit:
6464

65-
* `app.get(“/", async (req, res, next)` which returns all the notes for that day and the daily summary.&#x20;
65+
* `app.get(“/", async (req, res, next)` which returns all the notes for that day and the daily summary.
6666
* `app.post(“/add", async (req, res, next)` which accepts a new note entry and performs a sentiment analysis. We simplify the score by converting it to 1, 0, -1 for positive, neutral, negative and save it in our notes table.
6767

6868
```postgresql
@@ -146,8 +146,8 @@ not bad for less than an hour of coding.
146146

147147
### Final Thoughts
148148

149-
This app is far from complete but does show an easy and scalable way to get started with ML in Express. From here I encourage you to head over to our [docs](https://postgresml.org/docs/) and see what other features could be added.
149+
This app is far from complete but does show an easy and scalable way to get started with ML in Express. From here I encourage you to head over to our [docs](https://postgresml.org/docs) and see what other features could be added.
150150

151-
If SQL is not your thing, no worries. Check out or [JS SDK](https://postgresml.org/docs/open-source/korvus) to streamline all our best practices with simple JavaScript.&#x20;
151+
If SQL is not your thing, no worries. Check out or [JS SDK](https://postgresml.org/docs/open-source/korvus/) to streamline all our best practices with simple JavaScript.
152152

153-
We love hearing from you — please reach out to us on [Discord ](https://discord.gg/DmyJP3qJ7U)or simply [Contact Us](https://postgresml.org/contact) here if you have any questions or feedback.&#x20;
153+
We love hearing from you — please reach out to us on [Discord ](https://discord.gg/DmyJP3qJ7U)or simply [Contact Us](https://postgresml.org/contact) here if you have any questions or feedback.

pgml-cms/docs/open-source/pgml/README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ See the [API](api/) for a full list of all functions provided by `pgml`.
1818
Common tasks include:
1919
- [Splitting text - pgml.chunk()](api/pgml.chunk)
2020
- [Generating embeddings - pgml.embed()](api/pgml.embed)
21-
- [Generating text - pgml.transform()](guides/llms/text-generation.md)
21+
- [Generating text - pgml.transform()](api/pgml.transform)
2222
- [Streaming generated text - pgml.transform_stream()](api/pgml.transform_stream)
2323

2424
## Open-source LLMs
@@ -36,9 +36,9 @@ PostgresML defines four SQL functions which use [🤗 Hugging Face](https://hugg
3636

3737
PostgresML defines four SQL functions which allow training regression, classification, and clustering models on tabular data:
3838

39-
| Function | Description |
40-
|---------------|-------------|
39+
| Function | Description |
40+
|---------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
4141
| [pgml.train()](api/pgml.train) | Train a model on PostgreSQL tables or views using any algorithm from Scikit-learn, with the additional support for XGBoost, LightGBM and Catboost. |
42-
| [pgml.predict()](api/pgml.predict/) | Run inference on live application data using a model trained with [pgml.train()](pgml.train). |
43-
| [pgml.deploy()](api/pgml.deploy) | Deploy a specific version of a model trained with pgml.train(), using your own accuracy metrics. |
44-
| [pgml.load_dataset()](api/pgml.load_dataset) | Load any of the toy datasets from Scikit-learn or any dataset from Hugging Face. |
42+
| [pgml.predict()](api/pgml.predict/) | Run inference on live application data using a model trained with [pgml.train()](api/pgml.train). |
43+
| [pgml.deploy()](api/pgml.deploy) | Deploy a specific version of a model trained with pgml.train(), using your own accuracy metrics. |
44+
| [pgml.load_dataset()](api/pgml.load_dataset) | Load any of the toy datasets from Scikit-learn or any dataset from Hugging Face. |

pgml-cms/docs/open-source/pgml/api/pgml.predict/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ description: >-
1111
The `pgml.predict()` function is the key value proposition of PostgresML. It provides online predictions using the best, automatically deployed model for a project. The API for predictions is very simple and only requires two arguments: the project name and the features used for prediction.
1212

1313
```postgresql
14-
select pgml.predict (
14+
select pgml.predict(
1515
project_name TEXT,
1616
features REAL[]
1717
)

pgml-cms/docs/open-source/pgml/guides/supervised-learning/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ The `pgml.predict()` function is the key value proposition of PostgresML. It pro
106106
The API for predictions is very simple and only requires two arguments: the project name and the features used for prediction.
107107

108108
```postgresql
109-
select pgml.predict (
109+
select pgml.predict(
110110
project_name TEXT,
111111
features REAL[]
112112
)

pgml-cms/docs/open-source/pgml/guides/supervised-learning/clustering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ LIMIT 10;
2727

2828
## Algorithms
2929

30-
All clustering algorithms implemented by PostgresML are online versions. You may use the [pgml.predict](/docs/open-source/pgml/api/pgml.predict "mention")function to cluster novel data points after the clustering model has been trained.
30+
All clustering algorithms implemented by PostgresML are online versions. You may use the [pgml.predict](/docs/open-source/pgml/api/pgml.predict/ "mention")function to cluster novel data points after the clustering model has been trained.
3131

3232
| Algorithm | Reference |
3333
| ---------------------- | ----------------------------------------------------------------------------------------------------------------- |

pgml-cms/docs/open-source/pgml/guides/vector-database.md

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ In Postgres, a vector is just another data type that can be stored in regular ta
1010

1111
### Installing pgvector
1212

13-
If you're using our [cloud](https://postgresml.org/signup) or our Docker image, your database has _pgvector_ installed already. If you're self-hosting PostgresML, take a look at our [Self-hosting](/docs/open-source/pgml/developers/self-hosting/README) documentation.
13+
If you're using our [cloud](https://postgresml.org/signup) or our Docker image, your database has _pgvector_ installed already. If you're self-hosting PostgresML, take a look at our [Self-hosting](/docs/open-source/pgml/developers/self-hosting/) documentation.
1414

1515
### Working with vectors
1616

@@ -24,10 +24,8 @@ Using the example from [Tabular data](../../../introduction/import-your-data/sto
2424
{% tab title="SQL" %}
2525

2626
```postgresql
27-
ALTER TABLE
28-
usa_house_prices
29-
ADD COLUMN
30-
embedding VECTOR(384);
27+
ALTER TABLE usa_house_prices
28+
ADD COLUMN embedding VECTOR(384);
3129
```
3230

3331
{% endtab %}
@@ -49,8 +47,7 @@ At first, the column is empty. To generate embeddings, we can use the PostgresML
4947
{% tab title="SQL" %}
5048

5149
```postgresql
52-
UPDATE
53-
usa_house_prices
50+
UPDATE usa_house_prices
5451
SET embedding = pgml.embed(
5552
'Alibaba-NLP/gte-base-en-v1.5',
5653
address
@@ -77,8 +74,7 @@ SELECT
7774
address,
7875
(embedding::real[])[1:5]
7976
FROM usa_house_prices
80-
WHERE
81-
address = '1 Infinite Loop, Cupertino, California';
77+
WHERE address = '1 Infinite Loop, Cupertino, California';
8278
8379
```
8480

@@ -116,8 +112,7 @@ For example, if we wanted to find three closest matching addresses to `1 Infinit
116112
{% tab title="SQL" %}
117113

118114
```postgresql
119-
SELECT
120-
address
115+
SELECT address
121116
FROM usa_house_prices
122117
ORDER BY
123118
embedding <=> pgml.embed(
@@ -185,8 +180,7 @@ You can create an IVFFlat index with just one query:
185180
{% tab title="SQL" %}
186181

187182
```postgresql
188-
CREATE INDEX ON
189-
usa_house_prices
183+
CREATE INDEX ON usa_house_prices
190184
USING ivfflat(embedding vector_cosine_ops)
191185
WITH (lists = 71);
192186
```
@@ -207,8 +201,8 @@ CREATE INDEX
207201
{% tab title="SQL" %}
208202

209203
```postgresql
210-
EXPLAIN SELECT
211-
address
204+
EXPLAIN
205+
SELECT address
212206
FROM usa_house_prices
213207
ORDER BY
214208
embedding <=> pgml.embed(
@@ -242,8 +236,7 @@ On the other hand, because of the nature of centroids, if the dataset changes in
242236
{% tab title="SQL" %}
243237

244238
```postgresql
245-
REINDEX INDEX CONCURRENTLY
246-
usa_house_prices_embedding_idx;
239+
REINDEX INDEX CONCURRENTLY usa_house_prices_embedding_idx;
247240
```
248241

249242
{% endtab %}
@@ -270,10 +263,8 @@ You can create an HNSW index with just one query:
270263
{% tab title="SQL" %}
271264

272265
```postgresql
273-
CREATE INDEX ON
274-
usa_house_prices
275-
USING
276-
hnsw(embedding vector_cosine_ops);
266+
CREATE INDEX ON usa_house_prices
267+
USING hnsw(embedding vector_cosine_ops);
277268
```
278269

279270
{% endtab %}

0 commit comments

Comments
 (0)