Skip to main content

Amplifai is a package that allows you to transform your raw unstructured text into structured data in a few lines of codes.

Project description

AMPLIFAI

Overview

This package allows to extract information from unstructured data and turns this extracted information into structured data.

Features

  • Creates LLM powered extraction and structuration logic
  • Define your data structure using Pydantic models
  • Use any supported LLM provider
  • Extract structured data from unstructured text with a single method call
  • Type-safe results with Pydantic validation

Requirements

Requires python > 3.10 and relies on langchain and pydantic See the requirements file for more details

Installation

You can install the package via pip by running the following command:

pip install amplifai

Alternatively, you can use any of the numerous python package managers such as poetry and uv.

Usage

Here's a simple example of how to use AMPLIFAI to extract structured information from text:

from pydantic import BaseModel
from langchain_openai import ChatOpenAI
from amplifai import Amplifier

# Define your data model
class Person(BaseModel):
    name: str
    age: int
    phone_number: str | None = None
    email_adress: str | None = None

# Initialize the LLM and Amplifier
llm = ChatOpenAI(api_key="your-api-key", model="gpt-4")
amplifier = Amplifier[ChatOpenAI, Person](llm=llm)

# Extract structured data from text
text = "John Doe is 25 years old. He lives in Paris and can be reached at +33 6 12 34 56 78 or at firstname.name@gmail.com"
person = amplifier.denoise(text=text)

# Access the structured data
print(f"Name: {person.name}")
print(f"Age: {person.age}")
print(f"Phone: {person.phone_number}")
print(f"Email: {person.email_adress}")

The package also supports other LLM providers like MistralAI:

from langchain_mistralai import ChatMistralAI

llm = ChatMistralAI(api_key="your-api-key", model="mistral-large-latest")
amplifier = Amplifier[ChatMistralAI, Person](llm=llm)

In fact, you can use any LLM provider that is supported by langchain. However, you will need to first install the corresponding langchain integration.

Assuming you use pip:

pip install langchain-<provider>

Contributing

We love contributions from the community! There are many ways you can help make AMPLIFAI better:

Ways to Contribute

  • 🐛 Report Bugs: Found a bug? Please create an issue with detailed steps to reproduce it
  • 💡 Feature Requests: Have an idea for a new feature? Open an issue and let's discuss it
  • 📝 Improve Documentation: Help us make the documentation clearer and more comprehensive
  • 🔧 Code Contributions: Submit pull requests for bug fixes or new features
  • 🌟 Spread the Word: Star the repository and share it with your network

Code of Conduct

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

License

By contributing, you agree that your contributions will be licensed under the project's MIT License.

Let's build something amazing together! 🚀

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

amplifai-0.1.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

amplifai-0.1.0-py3-none-any.whl (7.4 kB view details)

Uploaded Python 3

File details

Details for the file amplifai-0.1.0.tar.gz.

File metadata

  • Download URL: amplifai-0.1.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for amplifai-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4a25556ee27832406667bf3f6052038707180ab7278d700e057b0767ae5ea61c
MD5 9971d9ed3de1c85f7eb12395aa193976
BLAKE2b-256 a5d29affc161e558fd19ec9fcb2d358ff31854c08475434d6ad7a7420926d74f

See more details on using hashes here.

File details

Details for the file amplifai-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: amplifai-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 7.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for amplifai-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9ce0d047939fc06896d3c4da159fe9a7c5f3ea620ffb82fec025f28de8b85d5b
MD5 b6ab66131c21b16f3573234347b5cbf7
BLAKE2b-256 a846273f6726541e76e51bd70792c3980fdd2143b4d97d5efa5e56a78824a9d0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page