Twitter Healthcare Expert Finder and Analysis Tool

Overview

The Twitter Healthcare Expert Finder and Analysis Tool is designed to streamline the identification and classification of medical experts on Twitter. Utilizing a combination of real-time data extraction and advanced natural language processing, this tool delivers a reliable list of healthcare professionals, ensuring users have access to trustworthy medical information.

Classifier comparison, confusion matrix and learning curve for the medical expert classifier
(a) Accuracy and F1 of four classifiers; (b) confusion matrix and (c) learning curve of the random forest. 5-fold stratified cross-validation on 1,040 labelled users.

How It Works

The tool leverages Twitter’s API to continuously extract tweets, employing sophisticated algorithms to categorize and analyze the content. A user-friendly dashboard presents these analytics, enabling users to quickly identify and follow credible medical experts and access their insights on important health topics.

Main Features

  • Data Extraction: Uses Twitter’s API for daily processing of extensive tweet volumes.
  • Tweet Classification: Advanced NLP techniques ensure tweets are accurately classified, distinguishing genuine medical advice from general information.
  • Real-time Analytics: An integrated dashboard provides immediate tracking and analytical capabilities to assess the engagement levels of identified experts.

Technical Specifications

  • Data Processing: Utilizes Python and Pandas for efficient data handling.
  • Machine Learning: Leverages Scikit-Learn for robust machine learning processes.
  • Twitter Data Extraction: Implements Tweepy for comprehensive Twitter data retrieval.
  • Web Application: Developed with Flask for a dynamic and responsive user experience.

Classification Results

Each user is represented by the text of their recent tweets (cleaned, stop words removed, lemmatized) as a bag-of-words vector. The labelled data in the repository has 1,040 users: 674 medical experts and 366 non-experts. With 5-fold stratified cross-validation, a random forest (300 trees, maximum depth 12) reaches 84% accuracy and an F1 score of 0.88 for the expert class, with 93% of experts correctly identified. Linear SVM and logistic regression perform similarly; Naive Bayes is lowest. The learning curve shows the validation score levelling off near 0.88 while the training score stays a few points higher, so more labelled users would help mainly at the margin.

View the project on GitHub GitHub