Generate inspiring quotes using a trained LSTM model, built on a dataset of 1000 quotes from various authors and backgrounds.
This project utilizes a Long Short-Term Memory (LSTM) neural network to generate quotes based on patterns learned from a curated dataset. The model was trained using quotes scraped from a website, ensuring diversity in language and style.
- Quote Generation: Input a starting phrase, word or choose random prompts to generate unique quotes.
- Web Interface: Access the model via a user-friendly Gradio interface for easy interaction.
- API Access: Integrate quote generation into other applications using the provided API endpoints.
-
Run the jupyter file then from last cell click on url to redirect to the deployed Gradio interface.
-
Enter a prompt to generate a quote.
-
Explore the generated quotes and their diversity.
For more example refer this video
- Send a POST request to the API endpoint with a JSON payload containing the prompt.
- Receive a JSON response with the generated quote.
- Python
from gradio_client import Client
client = Client("https://8a60bc40aabf89f175.gradio.live/")
result = client.predict(
Prompt="Hello!!",
nwords=13,
api_name="/predict"
)
print(result)
- JavaScript
import { Client } from "@gradio/client";
const client = await Client.connect("https://8a60bc40aabf89f175.gradio.live/");
const result = await client.predict("/predict", {
Prompt: "Hello!!",
nwords: 10,
});
console.log(result.data);
- Bash
curl -X POST https://8a60bc40aabf89f175.gradio.live/call/predict -s -H "Content-Type: application/json" -d '{
"data": [
"Hello!!",
10
]}' \
| awk -F'"' '{ print $4}' \
| read EVENT_ID; curl -N https://8a60bc40aabf89f175.gradio.live/call/predict/$EVENT_ID
Note : Load and run main.ipynb
and replace links with current active links. Directly goining to links will not work.
Contributions are welcome! Please fork the repository and create a pull request with your improvements.
This project is licensed under the MIT License. See the LICENSE file for details.