Building the Tool: Essential Software and Techniques
Data collection will be taken care of with the help of BeautifulSoup and Scrapy: These libraries are used for web scraping, which will help me gather data from other social media platforms and websites. BeautifulSoup is great for parsing HTML and XML documents, while Scrapy is a very capable framework for large-scale web scraping (Stsiopkina, 2024).
Preprocessing will be completed primarily with NLTK (Natural Language Toolkit) and spaCy. NLTK is a comprehensive library is used for various NLP tasks such as tokenisation, lemmatisation, and stemming. It’s a staple in the NLP community and provides a wide range of utilities for text processing (Bird, Klein, & Loper, 2009).
SpaCy, known for its efficiency and ease of use, is another NLP library that excels in tasks like named entity recognition and part-of-speech tagging. It is optimised for performance and is a great tool for processing large volumes of text data.
For model development I'll be leveraging key deep learning frameworks, namely TensorFlow and PyTorch. TensorFlow, developed by Google, is an open-source platform for machine learning. It’s highly versatile and supports a wide range of tasks, from simple linear regression to complex neural networks. TensorFlow’s scalability makes it ideal for both research and production (Abadi et al., 2016).
PyTorch is another popular deep learning framework known for its dynamic computational graph and ease of use. PyTorch is widely used in research settings due to its flexibility and intuitive interface. It’s particularly well-suited for tasks that require frequent debugging and modifications (Paszke et al., 2019).
I'll also be experimenting with pre-trained models via the Hugging Face Transformers Library. This library provides access to a vast array of pre-trained models, including BERT, GPT-3, and RoBERTa. Using these models can significantly accelerate the development process, allowing me to leverage state-of-the-art language understanding capabilities without training models from scratch (Wolf et al., 2020).
Evaluation, Validation and Performance
There are many techniques at my disposal to test the effectiveness of each model, but the ones I am gearing towards at this stage are:
- K-Fold Cross-Validation: This technique involves dividing the data into K subsets and training the model K times, each time using a different subset as the validation set and the remaining subsets as the training set. This method helps in ensuring that the model generalises well to unseen data.
- Stratified K-Fold Cross-Validation: Similar to K-Fold but ensures that each fold has the same proportion of classes as the entire dataset. This is particularly useful for imbalanced datasets
- Precision, Recall, F1-score, and Accuracy: These metrics will be used to evaluate the performance of the models. Precision measures the accuracy of positive predictions, recall measures the ability to find all relevant instances, the F1-score balances precision and recall, and accuracy provides the overall correctness of the model.
The final parts of this project will require the deployment of visualisation tools and further development to create a front end interface for the end user. For the visualisation element, my experience and initial research narrowed my search to the following libraries and frameworks:
- Matplotlib and Seaborn: These libraries are essential for creating static, animated, and interactive visualisations in Python. They are highly customisable and provide a wide range of plotting functions.
- Plotly: For more interactive and dynamic visualisations, Plotly is the go-to library. It integrates well with Dash, making it possible to create interactive web-based dashboards.
- Dash: Developed by Plotly, Dash is a framework for building analytical web applications. It’s perfect for creating user-friendly interfaces that allow users to interact with the data and visualisations dynamically.
Lastly, these solutions below are in my sights to help me bring it all together!
- Jupyter Notebooks: My favorite way to compile code when working with Python. These are ideal for exploratory data analysis and prototyping. They support live code, equations, visualisations, and narrative text, making them an excellent tool for iterative development.
- Flask: This lightweight WSGI web application framework in Python is perfect for developing and deploying web applications. It’s simple yet powerful and integrates well with other Python libraries.
- Heroku: For deploying the application, Heroku offers a cloud platform as a service (PaaS) that supports multiple programming languages. It’s user-friendly and provides a range of tools for managing the deployment process.
Building a sentiment analysis tool requires a combination of various specialised tools and libraries, each serving a specific purpose in the development process. By leveraging these tools, I will aspire to develop a robust sentiment analysis tool that meets the needs of users and provides valuable insights into social media sentiment....time to get stuck in!
References
- Abadi, M., Barham, P., Chen, J., Chen, Z., Davis, A., Dean, J., ... & Zheng, X. (2016) TensorFlow: A System for Large-Scale Machine Learning. 12th USENIX Symposium on Operating Systems Design and Implementation. Available at https://www.usenix.org/system/files/conference/osdi16/osdi16-abadi.pdf (Accessed: 9 July 2024)
- Bird, S., Klein, E., & Loper, E. (2009) Natural language processing with Python. O'Reilly Media (Accessed: 15 June 2024)
- Paszke, A., Gross, S., Massa, F., Lerer, A., Bradbury, J., Chanan, G., ... & Chintala, S. (2019) PyTorch: An imperative style, high-performance deep learning library. Available at https://papers.neurips.cc/paper/9015-pytorch-an-imperative-style-high-performance-deep-learning-library.pdf (Accessed: 7 July 2024)
- Stsiopkina, M. (2023) Web Scraping with Scrapy: Python Tutorial, Oxylabs. Available at https://oxylabs.io/blog/scrapy-web-scraping-tutorial (Accessed: 1 July 2024)
- Wolf, T., Debut, L., Sanh, V., Chaumond, J., Delangue, C., Moi, A., ... & Rush, A. M. (2020) Transformers: State-of-the-art natural language processing. Available at https://aclanthology.org/2020.emnlp-demos.6 (Accessed: 7 July 2024)
.jpg)





.jpg)