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

Example PostgresML application using Express JS

License

NotificationsYou must be signed in to change notification settings

postgresml/example-expressjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

The purpose of this repository is to demonstrates how to quickly get up and running with machine learning in an Express application.

This application is a simple note taking application. It analyzes all the notes taken in a day and performs summarization and sentiment analysis on them.

All our ML occurs in the database where the notes are stored. This means just by connecting to the database we are able to train and deploy ML/AI models and have a production ready pipeline.

Setup

This example application requires a PostgreSQL database with the pgml and pgvector extension installed. The easiest way to do this is with a free database atpostgresml.org.

Clone this repository. Once you have your PostgresML database, or local PostgreSQL with the extensions installed, create a .env file and addDATABASE_URL=<your_db_url> replacing your_db_url.

Next install all required node packages withnode install.

Running the app

Start the express server by running the following

npm run devStart

This will launch the application atlocalhost:3000

Usage

In a browser, navigate to localhost:3000. Recored a note in the text area on the left and click submit. Do this a couple times. On the right click Analyze Day, this will produce a sentiment analysis score and a summarization of your day.

Screenshot 2024-03-18 at 3 20 33 PM

Code

We can augment this code to perform all types of ML. Checkout thepostgresML docs for a full list.

If you are unhappy with the quality of the results, rest assured, higher quality models are available.

In this example we directly interacted with the extension using PostgreSQL. If you would prefer JS, see ourJS SDK

About

Example PostgresML application using Express JS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp