This project consists of a web scraper and keyword extractor designed to analyze discussions from the Universal Robots forum. The scraper collects forum posts, while the extractor processes them to generate AI-driven keywords using multiple techniques.
- The scraper collects data from the Universal Robots forum, retrieving:
- Titles of discussion topics.
- Main post content.
- User comments on each topic.
- The scraped data is saved in a JSON file for further processing.
- The extracted forum data is processed to generate relevant keywords using three different techniques:
- TF-IDF (Term Frequency-Inverse Document Frequency) – Identifies the most statistically important words.
- YAKE (Yet Another Keyword Extractor) – Extracts keywords from individual documents using statistical patterns.
- RAKE (Rapid Automatic Keyword Extraction) – Detects multi-word phrases based on word co-occurrence.
- The extracted keywords are saved in a new JSON file for easy analysis.
Ensure you have Python 3.12+ installed.
Run the following command in your terminal or command prompt:
pip install requests beautifulsoup4 nltk yake rake-nltk scikit-learn pandas
Open Python in your terminal:
python3.12 import nltk nltk.download("stopwords") nltk.download("punkt") exit()
- run the scraper.py script
The script scrapes forum topics and saves them in a JSON file. The output file will be automatically named based on the timestamp.
- run the keyword_extraction.py script
This script reads the latest scraped JSON file.
It applies TF-IDF, YAKE, and RAKE to extract important keywords.
Saves the output in keywords_output.json.
Ensure the scraper has run before executing the keyword extraction script. Check if the JSON file exists in the directory.
Run nltk.download("punkt") manually inside Python as explained above.
Run pip install rake-nltk to install the missing dependency.
{ "topics": [ { "title": "Remote TCP & Toolpath fails to start in UR simulator", "link": "https://forum.universal-robots.com/t/remote-tcp-toolpath-fails-to-start-in-ur-simulator/37757", "tfidf_keywords": ["urcap", "remote", "start", "tcp"], "yake_keywords": ["tcp", "toolpath", "version"], "rake_keywords": ["remote tcp toolpath fails start ur simulator"] } ], "summary": { "total_tfidf_keywords": {"robot": 5, "control": 3}, "total_yake_keywords": {"robot": 6, "program": 4}, "total_rake_keywords": {"technical questions category": 3}, "total_combined_keywords_filtered": {"robot": 10, "program": 7} } }