Skip to main content

GailBot API

Project description

GailBot

About

Researchers studying human interaction, such as conversation analysts, psychologists, and linguists all rely on detailed transcriptions of language use. Ideally, these should include so-called paralinguistic features of talk, such as overlaps, prosody, and intonation, as they convey important information. However, transcribing these features by hand requires substantial amounts of time by trained transcribers. There are currently no Speech to Text (STT) systems that are able to annotate these features. To reduce the resources needed to create transcripts that include paralinguistic features, we developed a program called GailBot. GailBot combines STT services with plugins to automatically generate first drafts of conversation analytic transcripts. It also enables researchers to add new plugins to transcribe additional features, or to improve the plugins it currently uses. We argue that despite its limitations, GailBot represents a substantial improvement over existing dialogue transcription software.

Find the full paper published by Dialogue and Discourse here.

Status

GailBot version: 0.1a11 (Pre-release) Release type: API

Installation

GailBot and the necessary dependencies can be installed using pip with the following commands:

    pip install --upgrade pip

    pip install gailbot
    pip install git+https://github.com/linto-ai/whisper-timestamped
    pip install git+https://github.com/m-bain/whisperx.git

Usage - GailBot API

This release features a convenient API to use GailBot and create custom plugin suites. To use the API and its features, import the GailBot package like the following:

    from gailbot import GailBot

Once you have imported the GailBot package, initialize an instance of GailBot called "gb" (or a name of your choosing) by doing the following ("ws_root" is takes a path to your workspace directory):

    gb = GailBot(ws_root="your_workspace_path")

The GailBot API's methods are now available through your GailBot instance. Check out GailBot's backend documentation for a full list of method and their uses here.

Example Usage 1 - Default Settings

Now, we will try to use the GailBot on an input audio file. To do so, we will need initiate a GailBot instance, add input audio file as source, and transcribe. This example uses GailBot's default settings with default engine (Whisper) and pre-installed plugin suite. Therefore, there is no need to create and apply profile settings. See the example below:

    from gailbot import GailBot

    gb = GailBot(ws_root="your_workspace_path")

    gb.add_source(
        source_path="your_source_file_path"
        output_dir="your_output_directory_path"
    )
    gb.transcribe()

Example Usage 2 - Custom Profile

Here is an example of using GailBot with your customized transcription profile. To do so, you'll need to create a profile and apply it to input source files before transcribing with GailBot. See example on how to create a profile:

    from gailbot import GailBot
    
    gb = GailBot(ws_root="your_workspace_path")

    gb.add_new_engine(
        "new_google_engine", 
        {"engine": "google", "google_api_key": GOOGLE_API_KEY}, 
        overwrite=True,
    )

    TEST_PROFILE = {
        "engine_setting_name": "new_google_engine",
        "plugin_setting": ["gb_hilab_suite"],
    }

    gb.add_source(source_path="path_to_your_source", output_dir="your_output_directory_path")
    gb.apply_setting_to_source("path_to_your_source", TEST_PROFILE)
    gb.transcribe()

In the example above, we added Google Cloud STT engine called "new_google_engine" using your Google engine API key. Then, we used the Google engine to create a new profile called TEST_PROFILE. Here we also use GailBot's default plugin suite called gb_hilab_suite. Finally, we apply our custom profile to our input source and transcribe.

Supported Plugin Suites

A core GailBot feature is its ability to apply plugin suites during the transcription process. While different use cases may require custom plugins, the Human Interaction Lab maintains and distributes a pre-developed plugin suite -- HiLabSuite. For more information about the default plugin suite, click here.

Custom Plugins

A core GailBot feature is its ability to allow researchers to develop and add custom plugins that may be applied during the transcription process, in addition to the provided built-in HiLabSuite. To create a compatible plugin suite for the Gailbot app, follow these steps:

  1. Prepare the Folder Structure and Files: Ensure your plugin suite directory contains the following files with specific names: "init.py," "CHANGELOG.md," "DOCUMENT.md," "TECH_DOCUMENT.md," "README.md," "format.md," and "config.toml." Include a subfolder named "src" within the main directory.

    File Descriptions:

    init.py: Used for package initialization and can be left empty. format.md: Provides users information about generated output files. CHANGELOG.md: Documents version-to-version changes. README.md: Offers a high-level explanation and purpose of the plugin suite. DOCUMENT.md: Contains specifics about algorithms, plugins, and developers. TECH_DOCUMENT.md: Explains technical aspects like logging implementation. config.toml: Vital file that outlines plugin execution order and settings.

  2. Configure config.toml: Begin with setting suite_name = "", matching the directory name. Define metadata in the [metadata] section, including Author, Email, and Version.

  3. Define Plugins: For each plugin, create a section in config.toml under plugins section. Specify plugin_name, dependencies, rel_path, and module_name.

    plugin_name: The name of your plugin. dependencies: A list of plugins needed before this one. rel_path: Path to the file with the plugin's apply function. module_name: The name of the file without the .py suffix.

  4. Plugin Coding: Define each plugin as a class with the exact name from plugin_name. Inside the class, include an apply function with the signature def apply(self, dependency_outputs: Dict[str, Any], methods: ). At the end of the apply function, set self.is_successful = True.

  5. Dependencies and Output Flow: Use the dependency_outputs dictionary to pass outputs between plugins. When a plugin depends on another, it receives previous plugin outputs through this dictionary, with plugin class name as the key. Ensure plugin classes are properly formatted in config.toml for the apply function to run.

With correctly structured files, codes, and dependencies, your plugins will run as intended when uploaded to Gailbot. Congratulations on creating your plugin suite for Gailbot, and thank you for following our tutorial! Happy transcribing!

Contribute

Users are encouraged to direct installation and usage questions, provide feedback, details regarding bugs, and development ideas by email.

Acknowledgements

Special thanks to members of the Human Interaction Lab at Tufts University and interns that have worked on this project.

Cite

Users are encouraged to cite GailBot using the following BibTex:

@article{umair2022gailbot,
  title={GailBot: An automatic transcription system for Conversation Analysis},
  author={Umair, Muhammad and Mertens, Julia Beret and Albert, Saul and de Ruiter, Jan P},
  journal={Dialogue \& Discourse},
  volume={13},
  number={1},
  pages={63--95},
  year={2022}
}

Liability Notice

Gailbot is a tool to be used to generate specialized transcripts. However, it is not responsible for output quality. Generated transcripts are meant to be first drafts that can be manually improved. They are not meant to replace manual transcription.

GailBot may use external Speech-to-Text systems or third-party services. The development team is not responsible for any transactions between users and these services. Additionally, the development team does not guarantee the accuracy or correctness of any plugin. Plugins have been developed in good faith and we hope that they are accurate. However, users should always verify results.

By using GailBot, users agree to cite Gailbot and the Tufts Human Interaction Lab in any publications or results as a direct or indirect result of using Gailbot.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

testgailbot002-0.1a11.tar.gz (735.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

testgailbot002-0.1a11-py3-none-any.whl (148.1 kB view details)

Uploaded Python 3

File details

Details for the file testgailbot002-0.1a11.tar.gz.

File metadata

  • Download URL: testgailbot002-0.1a11.tar.gz
  • Upload date:
  • Size: 735.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.12

File hashes

Hashes for testgailbot002-0.1a11.tar.gz
Algorithm Hash digest
SHA256 fd2e93951acb24fc65e916fdce28a4a0b9550058b521c5a2ff645e50cfd2891c
MD5 908f368768a7ae92d94acc276a604572
BLAKE2b-256 1d7e670866744f237c892d06e854550d24b71cb6e3821230e3314f0187e7ec0f

See more details on using hashes here.

File details

Details for the file testgailbot002-0.1a11-py3-none-any.whl.

File metadata

File hashes

Hashes for testgailbot002-0.1a11-py3-none-any.whl
Algorithm Hash digest
SHA256 31832fdfe8e2aba5bebd44d7d33d4e1c135fe0ee0f3f004e3cada404531d9b0e
MD5 57b7c557da2cfdfa27cf2a00812247d7
BLAKE2b-256 a53423413dcca49f9d252c5ec3836dbbf7db693756b9cd7d767f16c137a80afe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page