Home Applications iris-GenLab

iris-GenLab

This application is not supported by InterSystems Corporation. Please be notified that you use it at your own risk.
5
1 reviews
3
Awards
389
Views
0
IPM installs
0
2
Details
Releases
Reviews
Awards
Issues
Pull requests
Videos
Articles
Application support Machine Learning, LLM, NLP, PALM and OpenAI

What's new in this version

PEX production added with NLP functionality

Summary

IRIS-GenLab is a generative AI Application that leverages the functionality of Flask web framework, SQLALchemy ORM, and InterSystems IRIS to demonstrate Machine Learning, LLM, NLP, Generative AI API, Google AI LLM, Flan-T5-XXL model, Flask Login and OpenAI ChatGPT use cases.

one one one one one one one one one one one OEX license
image

Features

  • User registration and authentication
  • Chatbot functionality with the help of Torch (python machine learning library)
  • Named entity recognition (NER), natural language processing (NLP) method for text information extraction
  • PEX production to apply Named entity recognition (NER) on the given text
  • Sentiment analysis, NLP approch that identifies the emotional tone of the message
  • HuggingFace Text generation with the help of GPT2 LLM (Large Language Model) model and Hugging Face pipeline
  • Google PALM API, to access the advanced capabilities of Google’s large language models (LLM) like PaLM2
  • Google Flan-T5 XXL, a fine-tuned on a large corpus of text data that was not filtered for explicit contents.
  • OpenAI is a private research laboratory that aims to develop and direct artificial intelligence (AI)

Installation

  1. Clone/git pull the repo into any local directory
git clone https://github.com/mwaseem75/iris-GenLab.git
  1. Open a Docker terminal in this directory and run:
docker-compose build
  1. Run the IRIS container:
docker-compose up -d 

Getting Started

Open myconfig.py file in python/genlab folder and enter the required keys (For where to get theses keys, please read section below)
image

To Run Flask application

Run the below command in Git Bash terminal

docker-compose exec iris bash

Now run below command to start flask application

irispython ./python/app.py

image

To run the application Navigate to http://localhost:4040

Home Page

image

Register a User

To register a user, Click on Sign Up link
image

Once registered, the user will log in automatically, To sign out click on the User Name link and then click on Sign out.
In order to log in, click on Login link
image

Chatbot functionality with the help of Torch (python machine learning library)

Click on chatbot icon to start chating
image

Named entity recognition (NER)

Named entity recognition with spaCy, a open-source library for Natural Language Processing (NLP) in Python
image

PEX production to apply Named entity recognition (NER) on the given text

The repository already has running production, To view the production navigate to the below URL
http://localhost:55038/csp/irisapp/EnsPortal.ProductionConfig.zen?$NAMESPACE=IRISAPP
image
Select Python.NERService and go to the message viewer from the messages tab
image
Click on View raw content to view message details
image
The message displays NER text(selftext) along with the actual message

Sentiment analysis

Sentiment analysis, also referred to as opinion mining, is an approach to natural language processing (NLP) that identifies the emotional tone of the message
image

HuggingFace, Text generation (Gpt-2)

Text generation with the help of GPT2 LLM (Large Language Model) model and Hugging Face pipeline
image

Google PALM API

Google API to access the advanced capabilities of Google’s large language models (LLM) like PaLM2 with the PaLM API
image

Google PALM API requires [PALM_API_KEY] key

How to get Google Palm Api key

Navigate to Google Palm Api Key page, Click on “Create API Key in new project” and get API Key
image

Google Flan-T5-XXL

Flan-T5 is fine-tuned on a large corpus of text data that was not filtered for explicit content. Mainly used for Translation and question-answering
image
Google Flan-T5-XXl requires [HUGGINGFACEHUB_API_TOKEN] key

How to get Hugging Face key

Signup with hugging face and navigate to setting Hugging Face account settings, click on the new token to create a new token
image

OpenAI

OpenAI is a private research laboratory that aims to develop and direct artificial intelligence (AI)
image

Get OpenAI Key [OPENAI_API_KEY]

Application requires OpenAI API Key, sign up for OpenAI API on this page. Once you signed up and logged in, click on Personal, and select View API keys in drop-down menu. Create and copy the API Key
image

Application database

SQLALchemy will create below table:

  • user: To store User information

To view table details, navigate to
http://localhost:55038/csp/sys/exp/%25CSP.UI.Portal.SQL.Home.zen?$NAMESPACE=USER&
image

Special Thanks to:

Evgeny Shvarov for iris-embedded-python-template and
Guillaume Rongier for interoperability-embedded-python template for guidance

Read more
Made with
Install
zpm install iris-GenLab download archive
Version
1.0.121 Sep, 2023
ObjectScript quality test
Category
Technology Example
Works with
InterSystems IRISInterSystems IRIS for HealthCachéEnsemble
First published
17 Sep, 2023
Last checked by moderator
01 Nov, 2023Works