A python package that has classes that processes text and creates a rag chef chat agent that gives cooking tips and recipes.
How to install
pip install lyser
A class to perform text analysis on a given corpus.
Attributes:
corpus (str): The corpus to analyze.
Methods:
pipeline(): A function to perform text analysis on a given corpus.
Returns a list of tokens.
e.g. ['the', 'cat', 'sat', 'on', 'the', 'mat']
pos_tagging(): A function to perform POS tagging on a given corpus.
Returns a list of tuples containing the word and its POS tag.
e.g. [('the', 'DT'), ('cat', 'NN'), ('sat', 'VB'), ('on', 'IN'), ('the', 'DT'), ('mat', 'NN')]
visualize_word_cloud(): A function to visualize the word cloud of a given corpus.
Example:
analyzer = TextAnalyzer(corpus=sample_text)
analyzer.pipeline()
analyzer.pos_tagging()
analyzer.visualize_word_cloud()
A class to invoke Chef Chat
Attributes:
folder_path (str, pdf): path to folder_path with recipe files
query (str): user input
Methods:
data_loader(): A function that loads the pdf books in a folder and returns a list of documents.
Returns:
list: A list of documents. Each document is a dictionary with a 'page_content' key and 'metadata' key.
chat_summary(): A function that creates a chat summary
Returns:
chat_memory: A AgentTokenBufferMemory chat summary memory.
rag_agent(): A function that creates a rag agent that returns recipes of meals from cook pdf books
Returns:
agent_result: A dictionary with the output of the rag agent.
Example:
# chef_chat = ChefChat(folder_path="data", query="How can i make pineapple chicken")
print(chef_chat.rag_agent())
Release files for lyser 1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| lyser-1.3.tar.gz | 4.1 kB | Details |
Release files / lyser-1.3.tar.gz
| Download URL | lyser-1.3.tar.gz |
|---|---|
| Size | 4.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
638920fad0a062b7a432d425145348cd466bc08e28c3325437dff08e3a1a3a6c
|
|
BLAKE2b-256 checksum How to use checksums |
66f13a28a6534caa26d61c55876722e3d6bd4d76576b7117abdd5f6ca3a1eaf5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.11.3
|