- Hello guys, this is my small application used to predict comments are positive or negative.
- I used
selenium
to crawl the entire data from Shopee Vietnam with over than 23.000 records. Each record consists mainly of the client's comment and his number of stars for the his comment. - After training phase and several model evaluation techniques, the model was embedded into web using Django framework.
- The main field that my app concentrate on is fashion. So if you try to force the model predict on a wrong data (such as technology comments, food comments,...), The possibility is that the model can not predict accurately.
- So, if you are interested in my application, you can read more the documents inside the directory
Docs
. I write with such a clarity and precision for what techniques I used.
- Firstly, you need to create a new conda environment using
python 3.8.10
and then activate the new environment which you have just created.conda create --name sentiment python==3.8.10 pip conda activate sentiment
- OK, open your terminal at the same level with file
requirements.txt
to install some python packages.pip install -r requirements.txt
- And then, change your directory to
web
directory.and now, you are standing at pathcd web
.../SCL_KHVW_Sentiment_Analysis_Project/web/
- Finally, you can run the Django application by the followed command.
Because this application uses TensorFlow, SkLearn and some other heavy packages. So for the first time you run this app, it will take several seconds to load model and initialize some configuration, after that moment, the app can work smoothly.
python manage.py runserver
- OK, open your favorite browser and go to url http://localhost:8000, the super gorgeous interface of my app will appear like this 😅 (sorry front-end developers).
-
Run the followed command to run the application.
docker run --name sentiment-analysis -p 8000:8000 -d manhcuong8499/sentiment-analysis
-
[Optional] Verify the application is running.
docker ps docker logs sentiment-analysis
- The below result is the output of console:
Watching for file changes with StatReloader Performing system checks...
2023-10-11 04:12:50.799856: W tensorflow/stream_executor/platform/default/dso_loader.cc:64] Could not load dynamic library 'libcudart.so.11.0'; dlerror: libcudart.so.11.0: cannot open shared object file: No such file or directory 2023-10-11 04:12:50.799869: I tensorflow/stream_executor/cuda/cudart_stub.cc:29] Ignore above cudart dlerror if you do not have a GPU set up on your machine. System check identified no issues (0 silenced). October 11, 2023 - 04:12:51 Django version 3.1.4, using settings 'shopee_sentiment.settings' Starting development server at http://0.0.0.0:8000/ Quit the server with CONTROL-C.
-
Visit the http://localhost:8000 to see the application.
-
Realtime video demo with so cute host: https://youtu.be/iQgCI3D1mdo
-
After you run the application successfully, enter your comment at the textarea component, then click the button Send and wait a bit to get the predicted result.
-
OK, let's try with some negative comments.
-
OK, cool. Thank you so much. Let clone or download as zip my application and run on your machine. See you 😍.