Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
|
@@ -1,104 +1,104 @@
|
|
| 1 |
-
---
|
| 2 |
-
title: Text Rewrite with LangChain
|
| 3 |
-
emoji: π
|
| 4 |
-
colorFrom: green
|
| 5 |
-
colorTo:
|
| 6 |
-
sdk: streamlit
|
| 7 |
-
app_file: app.py
|
| 8 |
-
pinned: false
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
βββ
|
| 25 |
-
βββ
|
| 26 |
-
βββ
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
β
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
* **Customizable
|
| 37 |
-
* **
|
| 38 |
-
* **
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
* **
|
| 75 |
-
|
| 76 |
-
-
|
| 77 |
-
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
langchain-
|
| 88 |
-
langchain-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
* **
|
| 101 |
-
* **
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
|
|
|
| 1 |
+
---
|
| 2 |
+
title: Text Rewrite with LangChain
|
| 3 |
+
emoji: π
|
| 4 |
+
colorFrom: green
|
| 5 |
+
colorTo: indigo
|
| 6 |
+
sdk: streamlit
|
| 7 |
+
app_file: app.py
|
| 8 |
+
pinned: false
|
| 9 |
+
sdk_version: 1.44.1
|
| 10 |
+
---
|
| 11 |
+
|
| 12 |
+
# ReWriteCraft: Text Rewrite with Custom Tone and Dialect π¨
|
| 13 |
+
## Introduction
|
| 14 |
+
Welcome to **ReWriteCraft**! π This project allows you to rewrite your text in a customized tone and dialect using the **LLama 3.1** model. The app provides an intuitive interface to input your draft text and apply different tones (Formal/Informal) and dialects (American/British).
|
| 15 |
+
|
| 16 |
+
This app leverages LangChain and Ollama models to enhance the AI's rewriting capabilities. Whether you want to refine the tone of a formal letter or add a casual touch to your writing, this app has you covered! π
|
| 17 |
+
|
| 18 |
+
|
| 19 |
+
## Project Structure
|
| 20 |
+
The project is organized as follows:
|
| 21 |
+
```
|
| 22 |
+
ReWriteCraft/
|
| 23 |
+
β
|
| 24 |
+
βββ app.py # Main Streamlit application file
|
| 25 |
+
βββ requirements.txt # Python dependencies for the project
|
| 26 |
+
βββ LICENSE # License file (GNU)
|
| 27 |
+
βββ README.md # Project documentation
|
| 28 |
+
β
|
| 29 |
+
βββ assets/ # Folder containing output examples for tone and dialect conversion
|
| 30 |
+
β βββ FormaltoInformal/ # Folder with examples of text converted from formal to informal tone
|
| 31 |
+
β βββ InformaltoFormal/ # Folder with examples of text converted from informal to formal tone
|
| 32 |
+
```
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
## Features
|
| 36 |
+
* **Customizable Tone**: Choose between Formal or Informal tones for your rewritten text.
|
| 37 |
+
* **Customizable Dialect**: Choose between American or British dialects.
|
| 38 |
+
* **Easy-to-use Interface**: The app is built using Streamlit, making it interactive and simple.
|
| 39 |
+
* **Quick Response**: Rewritten text is generated with the help of the LLama 3.1 model.
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
## Prerequisites
|
| 43 |
+
Before running the project, ensure the following requirements are met:
|
| 44 |
+
1. **Install Ollama**: Ollama is the platform required to run the LLama 3.1 model. Follow the instructions on the Ollama official website to download and install it on your device.
|
| 45 |
+
2. **Download LLama 3.1 Model**: After installing Ollama, download the LLama 3.1 model by running the following command in your terminal:
|
| 46 |
+
```
|
| 47 |
+
ollama pull llama3.1
|
| 48 |
+
```
|
| 49 |
+
3. **Python Environment**: Ensure you have Python installed on your machine. It's recommended to use Python 3.9 or later for compatibility with the dependencies listed in `requirements.txt`.
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
## How to Use
|
| 53 |
+
1. **Clone the Repository**: Clone this repository to your local machine or server:
|
| 54 |
+
```
|
| 55 |
+
git clone https://github.com/iSathyam31/ReWriteCraft.git
|
| 56 |
+
cd ReWriteCraft
|
| 57 |
+
```
|
| 58 |
+
2. **Create a `.env` file**: In the root directory, create a `.env` file to store your LangChain API key:
|
| 59 |
+
```
|
| 60 |
+
LANGCHAIN_API_KEY=your_api_key_here
|
| 61 |
+
```
|
| 62 |
+
3. **Install Dependencies**: Install the required Python packages listed in the `requirements.txt`:
|
| 63 |
+
```
|
| 64 |
+
pip install -r requirements.txt
|
| 65 |
+
```
|
| 66 |
+
4. **Run the App**: Once the dependencies are installed, you can run the Streamlit app using:
|
| 67 |
+
```
|
| 68 |
+
streamlit run app.py
|
| 69 |
+
```
|
| 70 |
+
The app will be accessible in your browser at `http://localhost:8501`.
|
| 71 |
+
|
| 72 |
+
|
| 73 |
+
## Project Constraints
|
| 74 |
+
* **Word Limit**: The app currently supports a maximum of 1500 words for input. You can modify this limit in the code if needed. The input text must be within this word count to avoid performance issues.
|
| 75 |
+
* **Tone & Dialect Selection**:
|
| 76 |
+
- The options for tone (Formal/Informal) and dialect (American/British) are optional. You can choose one or both options based on your needs.
|
| 77 |
+
- If you want a specific tone or dialect applied to your text, simply check the corresponding boxes. You can apply both tone and dialect together or choose either one independently.
|
| 78 |
+
- This flexibility allows you to get a variety of outputs depending on your selection.
|
| 79 |
+
|
| 80 |
+
|
| 81 |
+
## Requirements
|
| 82 |
+
You can find the necessary dependencies in the `requirements.txt` file. Here is the list:
|
| 83 |
+
```
|
| 84 |
+
ipykernel
|
| 85 |
+
langchain==0.2.10
|
| 86 |
+
langchain_community==0.2.10
|
| 87 |
+
langchain-openai==0.1.17
|
| 88 |
+
langchain-groq==0.1.6
|
| 89 |
+
langchain-ollama==0.1.0
|
| 90 |
+
python-dotenv==1.0.1
|
| 91 |
+
streamlit
|
| 92 |
+
```
|
| 93 |
+
|
| 94 |
+
|
| 95 |
+
## License
|
| 96 |
+
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more information.
|
| 97 |
+
|
| 98 |
+
|
| 99 |
+
## Acknowledgements
|
| 100 |
+
* **LangChain**: Used for integrating LLMs and text processing functionalities.
|
| 101 |
+
* **Ollama**: The primary language model used in this project (LLama 3.1) for text generation.
|
| 102 |
+
* **Streamlit**: The framework used to build this interactive web app.
|
| 103 |
+
|
| 104 |
+
Thanks to all the developers and contributors of these tools for making them available to the open-source community! π
|