sentiment-analysis / README.md
layers2024's picture
Upload folder using huggingface_hub
7d55822 verified

A newer version of the Gradio SDK is available: 5.25.2

Upgrade
metadata
title: sentiment-analysis
app_file: app.py
sdk: gradio
sdk_version: 5.25.0

🎯 Análise de Sentimento em Avaliações de Produtos

Este sistema analisa o sentimento em avaliações de produtos em português usando o modelo BERT com fine-tuning em dados do e-commerce brasileiro.

🤖 Modelo

Utiliza o modelo BERT fine-tuned para análise de sentimentos, treinado com o dataset Olist Store, um conjunto público de mais de 100 mil avaliações de e-commerce brasileiro feitas entre 2016 e 2018.

🎯 Projeto

Desenvolvido como parte do projeto NLP-Sentinel por Luciano Ayres.

💻 Instalação Local

Pré-requisitos

  • Python 3.10+
  • Git (opcional)

Instalação

  1. Clone o repositório:
git clone [email protected]:lucianoayres/sentiment-analysis-app.git
cd sentiment-analysis-app
  1. Execute o script de instalação e inicialização:
./run.sh

O script irá:

  • Criar um ambiente virtual Python
  • Instalar as dependências necessárias
  • Iniciar a aplicação

🌐 Demo Online

Você pode acessar uma versão online da aplicação em: https://huggingface.co/spaces/layers2024/analise-de-sentimentos-avaliacao-de-produtos

Gradio will:

  • Start a local server (usually accessible at http://localhost:7860)
  • Print a shareable public URL (if share=True is set) so that you can try your app in your browser.

Deploying Your Gradio App to Hugging Face Spaces

Hugging Face Spaces provides a free and permanent hosting option for your Gradio demo. Follow the steps below to deploy your app using the terminal method:

1. Ensure You Have a Hugging Face Account

Make sure you have a free Hugging Face account. If not, create one here.

2. Deploy via Terminal

From your app's directory (where your app.py and requirements.txt reside), simply run:

gradio deploy

This command will gather basic metadata from your project, automatically create a new Space for you, and deploy your Gradio app.

  • To Update Your Space: Re-run the gradio deploy command, or you can enable GitHub Actions to automatically update your Space on git push.

3. Access and Share Your App

Once deployed, your app will be live at a URL in the following format:

https://<your-username>-<your-space-name>.hf.space

Share this URL with others to allow them to interact with your Gradio demo directly from their browsers.

Additional Information

  • Model Updates: If you update your model on Hugging Face, the next time your app runs (locally or on Spaces), it will load the latest version.
  • Hot Reload (Local Development): Instead of running python app.py, you can run:
    gradio app.py
    
    This enables hot reloading so your changes are automatically reflected in your demo.
  • Troubleshooting:
    • Ensure your virtual environment is activated before installing dependencies and running your script.
    • Verify that the package versions in your requirements.txt file are compatible with your code.
    • The initial launch might take extra time as your model files download from Hugging Face.

For further details, please refer to the Gradio Documentation and the Hugging Face Transformers Documentation.

sentiment-analysis-app

App de anális de sentimento em avaliações de produtos em português usando BERT com fine-tuning em dados do e-commerce brasileiro.

42cb5fa7402ec14e53cdffc7568dcf02fc9750fe