otree-whisper

Short oTree demonstration of Open AI's Whisper API.

https://github.com/clintmckenna/otree-whisper

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.1%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

Short oTree demonstration of Open AI's Whisper API.

Basic Info
  • Host: GitHub
  • Owner: clintmckenna
  • Language: Python
  • Default Branch: master
  • Size: 171 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Created over 1 year ago · Last pushed over 1 year ago
Metadata Files
Readme Citation

README.md

oTree Whisper API

This is a simple app that demonstrates Open AI's Whisper API for oTree. Please feel free to leave any feedback or open an issue if you spot a problem. I have only tested this in Windows 11 using Chrome.

Recording and Translation

The Start button will trigger a recording. Using oTree Live Pages function, the Stop button will save the base64 and webm file, and run this through Whisper.

screenshot

Update: for security and data concerns, Chris from oTree has advised to not save audio files directly to the server. I have updated the app to write to an Amazon S3 bucket. The base64 data is able to be passed directly to Whisper API via the requests package. The base64 text and transcript are saved to the player variables, so you can always recreate the audio samples if needed.

API key

To use this, you will need to acquire a key from OpenAI's API. Add this as an environment variable to your local environment or you can just paste it into the code. If you use Amazon S3 to save the audio samples, you will need to add these as well.

Package requirements

When using locally, you will also need to install the boto3 Python package if you plan to save the files to Amazon S3. Be sure to add these to your requrements.txt file before using online.

Citation

As part of oTree's installation agreement, be sure to cite their paper:

  • Chen, D.L., Schonger, M., Wickens, C., 2016. oTree - An open-source platform for laboratory, online and field experiments. Journal of Behavioral and Experimental Finance, vol 9: 88-97.

If this app was helpful, you may consider citing this github repository as well.

  • McKenna, C., (2024). oTree Whisper. https://github.com/clintmckenna/oTree-Whisper

Owner

  • Name: Clint McKenna
  • Login: clintmckenna
  • Kind: user
  • Location: Ann Arbor, MI
  • Company: University of Michigan

Graduate Student in Social Psychology

Citation (CITATION.cff)

# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!

cff-version: 1.2.0
title: oTree Whisper
message: >-
  If you use this software, please cite it using the
  metadata from this file.
type: software
authors:
  - given-names: Clint
    family-names: McKenna
repository-code: 'https://github.com/clintmckenna/oTree-Whisper'
date-released: '2024-06-03'

GitHub Events

Total
Last Year

Dependencies

requirements.txt pypi
  • otree >=5.0.0a21
  • psycopg2 >=2.8.4