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.
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
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)
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)
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)
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)
This feature will help user to get the sentiment of the text/sentence (Positive/Negative).
Supported Foundation models
- Anthropic Claude
- Amazon Titan
- 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)
This feature will help user to extract important keywords (Name,place) from the given sentence.
Supported Foundation models
- Anthropic Claude
- Amazon Titan
- 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)
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 = MeetingSummarizer()
response = ms.get_meeting_summary("<bucket_name>", "<file_name>")
print(response)
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!