Artifex offers a unique Python library that enables the creation of small, task-specific LLMs capable of performing offline NLP and text classification without any training data. Suitable for tasks like Intent Classification and Guardrail Models, it empowers users to efficiently handle various NLP challenges with minimal resources.
Artifex is a versatile Python library designed for crafting task-specific Large Language Models (LLMs) without the need for prior training data, making it an ideal solution for offline Natural Language Processing (NLP) and text classification tasks. This innovative tool can create small, efficient models that can be deployed locally, which not only streamlines development but also enhances privacy and performance.
Models developed using Artifex support various offline NLP tasks such as:
Create a Guardrail Model To establish a guardrail model, which helps in managing communication standards, follow these steps:
from artifex import Artifex
guardrail = Artifex().guardrail
guardrail.train(
instructions=[
"Soft medical advice is allowed, but should be general.",
"Discussions about cosmetic products are permitted.",
"Hard medical advice is prohibited in all cases."
]
)
Implementing the Model Replace API calls with your local model for message safety checks:
# Load your locally trained guardrail model
.guardrail.load("artifex_output/run-<timestamp>/output_model/")
is_safe = guardrail(user_message)
Create an Intent Classification Model To train a model for classifying intents based on user input:
from artifex import Artifex
intent_classifier = Artifex().intent_classifier
intent_classifier.train(
classes={
"send_email": "Intent to send an email.",
"schedule_meeting": "Intent to set up a meeting.",
"cancel_meeting": "Intent to cancel a meeting.",
"reschedule_meeting": "Intent to change a meeting's time.",
}
)
label = intent_classifier("I forgot to set up that meeting with John.")
print(label) # Outputs the classified intent
Discover more functionalities, tutorials, and use cases through the comprehensive documentation and community resources.
Artifex is positioned to significantly streamline and enhance the proficiency of NLP tasks by enabling developers to create specialized models efficiently, ultimately paving the way for more effective and relevant AI applications.
No comments yet.
Sign in to be the first to comment.