-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
@BP-Ent please review this guide. |
guide/14-deep-learning/use_mistral_llm_for_text_classification_and_entity_recognition.ipynb
Show resolved
Hide resolved
guide/14-deep-learning/use_mistral_llm_for_text_classification_and_entity_recognition.ipynb
Show resolved
Hide resolved
guide/14-deep-learning/use_mistral_llm_for_text_classification_and_entity_recognition.ipynb
Show resolved
Hide resolved
guide/14-deep-learning/use_mistral_llm_for_text_classification_and_entity_recognition.ipynb
Show resolved
Hide resolved
guide/14-deep-learning/use_mistral_llm_for_text_classification_and_entity_recognition.ipynb
Show resolved
Hide resolved
guide/14-deep-learning/use_mistral_llm_for_text_classification_and_entity_recognition.ipynb
Show resolved
Hide resolved
guide/14-deep-learning/use_mistral_llm_for_text_classification_and_entity_recognition.ipynb
Show resolved
Hide resolved
guide/14-deep-learning/use_mistral_llm_for_text_classification_and_entity_recognition.ipynb
Show resolved
Hide resolved
guide/14-deep-learning/use_mistral_llm_for_text_classification_and_entity_recognition.ipynb
Show resolved
Hide resolved
guide/14-deep-learning/use_mistral_llm_for_text_classification_and_entity_recognition.ipynb
Show resolved
Hide resolved
@BP-Ent Can you please quickly review this guide? Thanks. |
There was a problem hiding this 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 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Introduction to Mistral model
- Mistral Implementation in
arcgis.learn
- Install the model backbone
- Mistral with
TextClassifier
model - Import the
TextClassifier
class fromarcgis.learn.text
module - Initialize the
TextClassifier
model with databunch - Initialize the
TextClassifier
model without databunch - Classify text using the mistral model
- Load the model
- Save the model
- Mistral with the
EntityRecognizer
model - Import the
EntityRecognizer
class from thearcgis.learn.text
module - Initialize the
EntityRecognizer
model with databunch - Initialize the
EntityRecognizer
model without databunch - Extract entities using the mistral model
- Load the model
- Save the model
- Conclusion
- References
Reply via ReviewNB
@@ -0,0 +1,615 @@ | |||
{ |
There was a problem hiding this comment.
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 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,615 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,615 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,615 @@ | |||
{ |
There was a problem hiding this comment.
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 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,615 @@ | |||
{ |
There was a problem hiding this comment.
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 @@ | |||
{ |
There was a problem hiding this comment.
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 @@ | |||
{ |
There was a problem hiding this comment.
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
There was a problem hiding this 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
@BP-Ent I have made the suggested changes, thanks. |
PR merged on next branch |
Guide for Mistral workflow with text models