Jump to content

WDAudioLex

From Meta, a Wikimedia project coordination wiki
WDAudioLex

The Audio Lexeme Matching Tool aims to streamline the integration of audio pronunciations into existing linguistic databases, specifically leveraging the resources available on Wikidata. Users will select a Commons category with audio files and find corresponding lexemes which are the best match for the audio files. The tool provides a user-friendly interface where contributors can select a specific Commons category containing audio files. The tool will focus on facilitating user contributions by adding pronunciation audio statements while referencing existing lexemes on Wikidata. This ensures the creation of accurate and structured data entries, making pronunciation data more accessible for linguistic research and everyday use.

Objectives

  • Develop a user-friendly interface for selecting Commons categories, entering matching patterns, and viewing results.
  • Create a robust backend for handling requests, pattern matching, and managing user contributions.
  • Facilitate the addition of pronunciation audio statements (P443) to Wikidata while supporting pronunciation variety (P5237).
  • Maintain a dedicated database for tracking user submissions, including matched audio and lexeme IDs.
  • Ensure seamless integration with Wikidata APIs for validating lexemes and updating entries.

Timeline and Deliverables

Month 1: Research and Setup

  • Week 1: Research Commons and Wikidata APIs; compile available categories and lexeme structures.
  • Week 2: Set up Flask backend and define database schema.
  • Week 3: Implement initial API endpoints for category selection and contribution tracking.
  • Week 4: Establish ReactJS environment and basic UI components.


Month 2: Core Development

  • Week 5: Develop pattern matching logic in the backend.
  • Week 6: Display matched results in the frontend.
  • Week 7: Integrate an audio player for playback functionality.
  • Week 8: Enable submission of pronunciation audio statements to Wikidata.


Month 3: Testing and Deployment

  • Week 9: Conduct unit testing for backend endpoints.
  • Week 10: Perform full application integration testing.
  • Week 11: Optimize for performance and responsiveness.
  • Week 12: Deploy the application to the Wikimedia Cloud.

Technology Stack

Frontend

  • Framework: ReactJS
  • Description: The user interface is built with ReactJS to provide a dynamic and responsive experience. Key Components include:
    • Category Selector: Dropdown for selecting Commons categories.
    • Pattern Input: Text field for specifying matching patterns.
    • Results Display: A section to display matched lexemes and audio files.
    • Audio Player: A playback feature to listen to audio files.
    • Add Pronunciation Button: A tool for submitting matched pronunciations to Wikidata.
  • Styling Framework: Material-UI or Bootstrap ensures a professional and responsive design.
  • Supporting Tools:
    • Axios: Manages API communication with the backend.
    • React Router (Optional): Used for navigation between different sections.

Backend

  • Framework: Flask
  • Description: Flask is a Python-based web framework handling server-side logic and communication with the frontend.
  • Core Features:
    • Pattern Matching Logic: Matches user-defined patterns with audio files and lexemes.
    • Database Integration: Stores and retrieves data using Flask-SQLAlchemy.
    • API Endpoints:
      • /select-category: Fetch audio files from selected categories.
      • /match-lexemes: Match lexemes to audio files based on user input.
      • /add-pronunciation: Add pronunciation data to Wikidata and log user contributions.
    • Supporting Tools:
      • Flask-CORS: Ensures compatibility between the frontend and backend.
      • Langcodes Library: Processes language codes when fetching audio files and lexemes.

Database

  • Technology: MariaDB
  • Description: A relational database is used to store and manage user contributions.
  • Key Tables:
    • Audio Files: Metadata of audio files from Commons.
    • User Contributions: Tracks user-submitted pronunciations, lexeme matches, and other details.
  • Supporting Tools:
    • Flask-Migrate: Manages database migrations and schema updates.

APIs and Integration

  • Technologies: Wikimedia Commons API, Wikidata API
  • Commons API: Retrieves audio files and categories from Wikimedia Commons.
  • Wikidata API: Handles lexeme validation and submission of pronunciation data, including audio statements (P443) and pronunciation varieties (P5237).

Deployment

Technologies:

  • Flask-Gunicorn: A WSGI server used to deploy the backend application.
  • Wikimedia Cloud Services: Hosts the tool, making it accessible to users.
  • Docker (Optional): Provides containerization for efficient deployment and scaling.