This project provides an interactive interface to find and generate emojis based on input text. The interface consists of an input box for entering text and two buttons: Find
and Generate
. When a user submits text, the system processes it through a BERT model and calculates cosine similarity to match emojis from a predefined dataset. If matching emojis are found, the top five emojis are displayed. By clicking the Generate
button, the user can generate an emoji using an API call to a fine-tuned model on a specific emoji dataset.
- Text Input: Input box to enter text for emoji search.
- Submit Button: Processes the input text and displays matching emojis.
- Generate Button: Generates an emoji using a fine-tuned model via API call.
- streamlit
- replicate
- pillow
- transformers
- gensim==3.8.3
- emoji-data==0.1.6
- scikit-learn==1.4.2
- scipy==1.10.0
-
Clone the Repository
git clone https://github.com/Lakshyadevelops/EmojiGen.git
-
Create a virtual environment
conda create -n emojigen python=3.9 conda activate emojigen
-
Install Dependencies
pip install -r requirements.txt
-
Run the Streamlit Application
streamlit run main.py
-
Open the Application Open your web browser and go to
http://localhost:8501
. -
Input Text Enter the text you want to analyze in the input box.
-
Find Text Click the
Find
button. The text will be processed, and the top four matching emojis will be displayed if found. -
Generate Emoji Click the
Generate
button to generate an emoji using the fine-tuned model via API call.
-
Text Processing
- The input text is passed through a pre-trained BERT model to obtain embeddings.
-
Cosine Similarity Calculation
- Cosine similarity is calculated between the text embeddings and the embeddings of emojis in the dataset.
-
Emoji Matching
- The top five matching emojis based on cosine similarity are displayed.
-
Emoji Generation
- Upon clicking the
Generate
button, an API call is made to a server where a fine-tuned model generates an emoji based on the input text.
- Upon clicking the
Feel free to fork this repository and contribute by submitting a pull request.
This project is licensed under the MIT License.