How aye-nyeinsan/myanmarsentencesanalysis works
Project Type & Purpose
• The project is focused on sentiment analysis for Burmese text. Its primary functions are to scrape comments (likely from web sources using selenium) and tokenize the text using the myWord library.
• The README confirms its use for text segmentation (syllable, word, and phrase segmentation) with external dictionary support and tokenizing tools.
Main Components
• Comment Scraper:
• Represented by the “Comment_Scrapper.py” file.
• Uses selenium (and pandas as mentioned in the README) to scrape or gather Burmese comments from target websites.
• Tokenization Module (myWord Integration):
• The project leverages the myWord library (included as an external submodule under the “external/myWord” folder).
• This library has several segmentation scripts (e.g., word_segment.py, syl_segment.py, phrase_segment.py) and a module “myword.py”.
• It is used to tokenize scraped text into syllable, word, and phrase components.
• Dictionary Preparation & Preprocessing:
• Under “external/myWord/dict_ver1”, there are several splitted bigram dictionary files.
• The provided “combine-all-splitted-files.sh” script combines these individual files into large unified dictionary files (bigram-phrase.bin, bigram-phrase.txt, etc.).
• This component is essential for the tokenizing process as the dictionary data supports the segmentation logic.
• Test Script & Execution Flow:
• “testscript.py” acts as an integration test to run the tokenization process.
• The output (in “output.txt”) is used to verify that all components interact properly.
• External Dependencies & Environment:
• The project uses external libraries (Selenium, pandas) which are installed via “requirements.txt”.
• Git modules and configuration files (.gitmodules, .gitignore) indicate integration with version control and submodule management for the myWord package.
Relationships & Interactions
• The Comment Scraper retrieves Burmese text content.
• The scraped data is then passed to the tokenization module (via myWord’s tokenize_text() and other segmentation functions) for processing.
• Dictionary Preparation is a prerequisite step whereby the segmented dictionaries used by myWord are combined; this is done outside the main script (step 1 in the README) and impacts how accurately text will be tokenized.
• Test script execution (testscript.py) demonstrates the overall flow by combining functionality and verifying output.
Architectural Patterns & Design Principles
• Modular Design: The project separates concerns into distinct modules (scraping, tokenization, dictionary preparation).
• Pipeline Flow: Data flows from acquisition (scraping) to processing (tokenization using external dictionaries) to output verification.
• External Dependency Management: the use of a requirements file and Git submodules reinforces a clean separation between the core project and external libraries (myWord).
• Reusability & Extensibility: The tokenizing functions are exposed (as in the provided tokenize_text() example) for use elsewhere.