Skip to main content

HolboxAI package

Project description

HolboxAI Package

Welcome to HolboxAI, a comprehensive AI package designed to enhance your data processing and creative capabilities. HolboxAI offers a range of functionalities including text-to-image generation, running textual queries on documents stored in your S3 bucket, and generating insights from natural language queries. This README provides a detailed guide on how to install and use the various features of HolboxAI.

Installation

To get started with HolboxAI, you need to install the package. Run the following command in your terminal:

pip install holboxai

After installation, you can import HolboxAI into your project using:

import holboxai as hb

Features

1. RAG

To run textual queries on your S3 bucket documents, follow these steps: Load Documents from S3 Bucket: First, import the S3DocReader class and initialize it. Then, call the get_bucket() method and provide the name of your S3 bucket as its argument.

## To Select the documents from entire s3 bucket
reader = hb.S3DocReader()
documents = reader.get_docs(bucket="<bucket_name>")

## To select a specific document
doc_file = reader.get_file(bucket="<bucket_name>",file_name="file_name")
  • Index Documents and Generate Response:

    Next, import the DocsQuery class. Use createindexes() to index the documents and query() to generate the response for your prompted query.

    docsQuery = hb.DocsQuery()
    indexes = docsQuery.create_index(documents)
    query = " "  # Your query here
    response = docsQuery.query(indexes, query)
    
  • Validate Sources:

    To validate the sources that generated the response of your query, import RelevantDocs and call get_docs(). This will show all the documents from which the response is created.

    rel_docs = hb.RelevantDocs()
    docs = rel_docs.get_docs(query=query, n_docs=4, retriever=indexes)
    

2. Generating Insights from CSV Files

This feature will help User to get insight from .csv file using natural language.

  • For insight on single csv file
    import pandas as pd
    
    csv_insight = hb.CsvQuery()
    query = "your query"
    df = pd.read_csv("<csv_file_path>")
    response = csv_insight.single_csv_query(df , query)
    print(response)
    
  • For insight on multiple csv files
    import pandas as pd
    
    csv_insight = hb.CsvQuery()
    query = "your query"
    df1 = pd.read_csv("<csv_file1_path>")
    df2 = pd.read_csv("<csv_file2_path>")
    dfs = [df1,df2]
    response = csv_insight.multi_csv_query(dfs , query)
    print(response)
    

3. Generating Images from Text Prompts

To generate images based on your text prompts, use the text2image module. The generate_image() method's arguments include your desired prompt, guidance scale, and inference steps.

txt2img = hb.text2image()
prompt = "a sports car, on a racing track,4K" # Change the prompt according to requirement
txt2img.generate_image(prompt=prompt,cfg_scale=5, infernce_steps=25) 
  • cfg_scale = Guidance scale is a parameter that controls how much the image generation process follows the text prompt. The higher the value, the more the image sticks to a given text input and vice-versa. It ranges from (1-20)

  • inference_steps = Inference steps controls how many steps will be taken during this process. The higher the value, the more steps that are taken to produce the image. It ranges from (5-100)

4. Getting Summary of the documents from S3 bucket

This feature will summarize the selected document from the s3 bucket for user.

reader = hb.S3DocReader()
docs = reader.get_file(bucket_name="<Bucket Name>",file_name = "<File Name>")
doc_summary = hb.Summarizer()
summary = doc_summary.summarize(docs)
print(summary)

5. Getting Sentiment of a text/sentence

This feature will help user to get the sentiment of the text/sentence (Positive/Negative).

Supported Foundation models

  1. Anthropic Claude
  2. Amazon Titan
  3. Cohere (Default)
sa = hb.SentimentAnalysis()
response = sa.get_sentiment(text="<text>")
print(response)
sa = hb.SentimentAnalysis()
response = sa.get_sentiment( text="<text>", model="Amazon Titan")
print(response)

6. Getting name and entity from a text/sentence

This feature will help user to extract important keywords (Name,place) from the given sentence.

Supported Foundation models

  1. Anthropic Claude
  2. Amazon Titan
  3. Cohere (Default)
ner = hb.NameEntityRecognition()
response = ner.get_entity(text="<text>")
print(response)
ner = hb.NameEntityRecognition()
response = ner.get_entity(text="<text>", model = "Anthropic Claude")
print(response)

7. Meeting Summarizer

This feature will allow user to get things like sentiment, sentiment score, Action Items, summary of each topic discussed and the total time, each individual had spoken in the meeting. Supported File Format: vtt and txt. The structure of the content inside the file must be mantained, refer demo meeting_summary.txt file in demoFiles folder.

ms = hb.MeetingSummarizer()
response = ms.get_meeting_summary("<bucket_name>", "<file_name>")
print(response)

Conclusion

HolboxAI is designed to simplify complex AI functionalities and make them accessible for various applications. Whether you're querying documents, generating creative images, or seeking insights from data, HolboxAI provides the tools you need. Enjoy exploring the capabilities of HolboxAI in your projects!

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

holboxai-0.12.tar.gz (16.8 kB view hashes)

Uploaded Source

Supported by

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