Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mistral workflow with text models #1794

Closed
wants to merge 8 commits into from
Closed

Conversation

SurajBaloni
Copy link
Collaborator

Guide for Mistral workflow with text models

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@SurajBaloni SurajBaloni requested a review from BP-Ent April 12, 2024 03:40
@SurajBaloni
Copy link
Collaborator Author

@BP-Ent please review this guide.

@kapil-varshney
Copy link
Contributor

@BP-Ent Can you please quickly review this guide? Thanks.

Copy link
Contributor

@kapil-varshney kapil-varshney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -0,0 +1,615 @@
{
@@ -0,0 +1,615 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mistral 7B is a decoder-based language model trained using almost 7 billion parameters designed to deliver both efficiency and high performance for real-world applications.


Reply via ReviewNB

@@ -0,0 +1,615 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mistral with the TextClassifier model


Reply via ReviewNB

@@ -0,0 +1,615 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Import the TextClassifier class from the arcgis.learn.text module


Reply via ReviewNB

@@ -0,0 +1,615 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initialize the TextClassifier model with databunch


Reply via ReviewNB

@@ -0,0 +1,615 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below are the parameters to be passed into EntityRecognizer :

backbone: To use mistral as the model backbone, use backbone="mistral".

examples: User defined examples for the mistral model, in python list format:

prompt: Text string describing the task and its guardrails. This is an optional parameter.


Reply via ReviewNB

@@ -0,0 +1,615 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extract entities using the mistral model


Reply via ReviewNB

@@ -0,0 +1,615 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To extract named entities using the mistral model, use the extract_entities method from the EntityRecognizer class. The input to the method will be a text string or a list of text strings.


Reply via ReviewNB

@@ -0,0 +1,615 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To load a saved mistral model, use the from_model method from the EntityRecognizer class.


Reply via ReviewNB

@@ -0,0 +1,615 @@
{
Copy link
Collaborator

@BP-Ent BP-Ent Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this guide we demonstrated the steps to initialize and perform inference using the Mistral LLM as a backbone with the TextClassifier and EntityRecognizer models in arcgis.learn.


Reply via ReviewNB

BP-Ent
BP-Ent previously requested changes Apr 15, 2024
Copy link
Collaborator

@BP-Ent BP-Ent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested changes made on reviewnb

@SurajBaloni
Copy link
Collaborator Author

SurajBaloni commented Apr 16, 2024

Suggested changes made on reviewnb

@BP-Ent I have made the suggested changes, thanks.

@priyankatuteja
Copy link
Collaborator

PR merged on next branch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants