Changeset 35454


Ignore:
Timestamp:
2021-09-23T14:13:40+12:00 (3 years ago)
Author:
cstephen
Message:

Improve translations
Improve translation test return
Begin adding WordTimingSelector

Location:
main/trunk/model-interfaces-dev/atea
Files:
1 added
11 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/README.md

    r35389 r35454  
    2525Firstly, development-specific code needs to be changed.
    2626
    27 1. In `TranscribeModule.js` change the `queryUrl` property to point to the primary transcribe endpoint.
     271. In `TranscribeModule.js` rename the transcribe methods to stop the test data being returned.
    2828
    2929    ```js
    30     -- this.queryUrl = "//localhost:8383/gs3-koreromaori/transcribe/test";
    31     ++ this.queryUrl = "//localhost:8383/gs3-koreromaori/transcribe";
     30    -- async transcribeFiles(files) {
     31    ++ async transcribeFilesTest(files) {
     32    // And
     33    -- async transcribeFilesActual(files) {
     34    ++ async transcribeFiles(files) {
    3235    ```
    3336
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/App.vue

    r35451 r35454  
    1414        </div>
    1515
    16         <div v-if="showInfo" class="paper">
    17             A tool to transcribe audio recordings of spoken Māori. Basic support for editing the transcriptions is provided,
    18             and they can be downloaded in multiple formats.
    19             <br />
    20             The actual transcriptions are produced with gratitude by using <a href="https://koreromaori.io">koreromaori.io</a>'s service.
    21         </div>
     16        <div v-if="showInfo" class="paper" v-html="translations.get('Description')" />
    2217    </div>
    2318
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/AudioTimeBar.vue

    r35451 r35454  
    33    <input type="range" class="slider-continuous" v-model.number="sliderValue" min="0" :max="audioLength" step="0.01" :disabled="isDisabled" />
    44
    5     <button type="button" class="btn-fab" @click="stepBack" :disabled="isDisabled">
     5    <button type="button" class="btn-fab theme-flat" @click="stepBack" :disabled="isDisabled">
    66        <span class="material-icons mdi-s">arrow_back_ios_new</span>
    77    </button>
     
    99    <span>{{ stringSliderValue }}</span>
    1010
    11     <button type="button" class="btn-fab" @click="stepForward" :disabled="isDisabled">
     11    <button type="button" class="btn-fab theme-flat" @click="stepForward" :disabled="isDisabled">
    1212        <span class="material-icons mdi-s">arrow_forward_ios</span>
    1313    </button>
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/TranscriptionItemEditor.vue

    r35451 r35454  
    2020    </div>
    2121
     22    <word-timing-selector :surroundingWords="getSurroundingWords()" />
     23
    2224    <div class="editor-controls">
    2325        <audio-time-bar v-model.number="currentPlaybackTime" :audio-length="audioLength" :isDisabled="playbackState.id != transcription.id" />
     
    8183import AudioPlayback from "../js/AudioPlaybackModule"
    8284import AudioTimeBar from "./AudioTimeBar.vue"
     85import WordTimingSelector from "./WordTimingSelector.vue"
    8386import Util from "../js/Util";
    8487
     
    114117    name: "TranscriptionItemEditor",
    115118    components: {
    116         AudioTimeBar
     119        AudioTimeBar,
     120        WordTimingSelector
    117121    },
    118122    props: {
     
    146150        async playAudio(startTime) {
    147151            await AudioPlayback.play(this.transcription.id, startTime);
     152        },
     153        getSurroundingWords() {
     154            return this.words.slice(2, 7);
    148155        },
    149156        /**
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/js/TranscribeModule.js

    r35439 r35454  
    6767export default class TranscribeService {
    6868    constructor() {
     69        /* eslint-disable quotes */
     70        this.TEST_JSON = '{"file_name":"akl_mi_pk_0002.wav","log":"Took 0.6s to transcribe 8.7s audio file /tmp/transcribe-aw7ujpu8-clean.wav","metadata":[{"char":"k","prob":7.0E-6,"start_time":0.24},{"char":"o","prob":8.3E-5,"start_time":0.26},{"char":"t","prob":0.995578,"start_time":0.42},{"char":"a","prob":0.997089,"start_time":0.44},{"char":"h","prob":3.0E-6,"start_time":0.54},{"char":"i","prob":8.0E-6,"start_time":0.56},{"char":" ","prob":2.2E-5,"start_time":0.6},{"char":"a","prob":0.982987,"start_time":0.64},{"char":"n","prob":5.0E-6,"start_time":0.8},{"char":"ō","prob":1.82E-4,"start_time":0.84},{"char":" ","prob":0.996944,"start_time":1.08},{"char":"t","prob":1.23E-4,"start_time":1.14},{"char":"e","prob":6.3E-5,"start_time":1.16},{"char":" ","prob":0.587595,"start_time":1.28},{"char":"t","prob":4.91E-4,"start_time":1.34},{"char":"u","prob":0.010654,"start_time":1.36},{"char":"p","prob":5.9E-5,"start_time":1.52},{"char":"u","prob":1.26E-4,"start_time":1.54},{"char":"n","prob":0.0,"start_time":1.7},{"char":"a","prob":0.99997,"start_time":1.72},{"char":" ","prob":0.993724,"start_time":2.14},{"char":"o","prob":4.3E-5,"start_time":2.22},{"char":" ","prob":0.99696,"start_time":2.32},{"char":"t","prob":1.4E-5,"start_time":2.36},{"char":"e","prob":3.8E-5,"start_time":2.38},{"char":" ","prob":0.996606,"start_time":2.48},{"char":"t","prob":0.0,"start_time":2.52},{"char":"a","prob":0.994873,"start_time":2.54},{"char":"ŋ","prob":2.9E-5,"start_time":2.64},{"char":"a","prob":0.994639,"start_time":2.66},{"char":"t","prob":3.0E-6,"start_time":2.8},{"char":"a","prob":0.99995,"start_time":2.82},{"char":" ","prob":0.0,"start_time":2.9},{"char":"m","prob":0.999606,"start_time":2.98},{"char":"ā","prob":0.010628,"start_time":3.0},{"char":"o","prob":0.996415,"start_time":3.2},{"char":"r","prob":0.0,"start_time":3.28},{"char":"i","prob":0.999698,"start_time":3.32},{"char":" ","prob":0.997927,"start_time":4.5},{"char":"k","prob":0.0,"start_time":4.58},{"char":"o","prob":3.2E-5,"start_time":4.6},{"char":" ","prob":0.956949,"start_time":4.7},{"char":"r","prob":2.5E-5,"start_time":4.74},{"char":"a","prob":0.997649,"start_time":4.76},{"char":"ŋ","prob":0.0,"start_time":4.9},{"char":"i","prob":1.63E-4,"start_time":4.92},{"char":"n","prob":1.3E-5,"start_time":5.28},{"char":"u","prob":4.0E-6,"start_time":5.3},{"char":"i","prob":0.99997,"start_time":5.42},{"char":" ","prob":0.994305,"start_time":5.78},{"char":"e","prob":3.1E-5,"start_time":5.84},{"char":" ","prob":0.966097,"start_time":6.04},{"char":"t","prob":2.0E-6,"start_time":6.1},{"char":"Å«","prob":5.4E-5,"start_time":6.12},{"char":" ","prob":0.837368,"start_time":6.34},{"char":"n","prob":0.0,"start_time":6.38},{"char":"e","prob":0.004238,"start_time":6.4},{"char":"i","prob":0.99966,"start_time":6.5},{"char":" ","prob":0.99728,"start_time":7.28},{"char":"o","prob":6.28E-4,"start_time":7.36},{"char":" ","prob":0.961049,"start_time":7.48},{"char":"p","prob":5.0E-6,"start_time":7.52},{"char":"a","prob":0.984707,"start_time":7.54},{"char":"p","prob":9.0E-6,"start_time":7.66},{"char":"a","prob":0.998754,"start_time":7.68},{"char":"t","prob":0.002356,"start_time":7.88},{"char":"Å«","prob":1.24E-4,"start_time":7.9},{"char":"ā","prob":0.883958,"start_time":8.0},{"char":"n","prob":0.985871,"start_time":8.24},{"char":"u","prob":0.907369,"start_time":8.26},{"char":"k","prob":0.999045,"start_time":8.38},{"char":"u","prob":0.995632,"start_time":8.4}],"success":true,"transcription":"kotahi anō te tupuna o te tangata māori ko ranginui e tÅ« nei o papatūānuku"}';
     71        /* eslint-enable quotes */
     72
    6973        /** @type {String} The URL to which query POST requests should be made. */
    70         this.queryUrl = "//localhost:8383/gs3-koreromaori/transcribe/test";
     74        this.queryUrl = "//localhost:8383/gs3-koreromaori/transcribe";
    7175
    7276        /** @type {Number} The maximum number of files which can be transcribed in one request to the API. */
     
    117121     */
    118122    async transcribeFiles(files) {
     123        const objects = [];
     124
     125        for (const file of files) {
     126            const object = JSON.parse(this.TEST_JSON);
     127            object.file_name = file.name;
     128            objects.push(object);
     129        }
     130
     131        return objects;
     132    }
     133
     134    /**
     135     * Performs a query to transcribe the given audio files.
     136     *
     137     * @param {FileList | File[]} files The files to upload.
     138     * @returns {Promise<TranscriptionModel[]>} The transcribed audio file.
     139     * @throws {TranscriptionError} When the transcription request fails to complete.
     140     */
     141    async transcribeFilesActual(files) {
    119142        const that = this;
    120143        const formData = new FormData();
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/main.js

    r35450 r35454  
    162162
    163163                const namespaceEndIndex = components[0].lastIndexOf(".");
    164                 translations.set(components[0].slice(namespaceEndIndex + 1), components[1]);
     164                translations.set(components[0].slice(namespaceEndIndex + 1), components.slice(1).join("="));
    165165            }
    166166
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/styles/_material.scss

    r35451 r35454  
    7373    border: none;
    7474    box-shadow: var(--primary-box-shadow-thin);
    75 
    7675    border-radius: var(--border-radius);
    7776    padding: 0.5em;
     77
    7878    cursor: pointer;
    7979    font-size: 1rem;
     80    font-weight: 400;
    8081    text-decoration: none;
    8182
     
    161162    font-style: italic;
    162163    cursor: inherit;
     164    user-select: none;
    163165}
    164166
     
    448450
    449451    &:hover {
    450         --bg-color: rgba(var(--primary-bg-color), 0.15);//#EEE;
     452        --bg-color: rgba(var(--primary-bg-color), 0.15);
    451453    }
    452454}
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/vue.config.js

    r35447 r35454  
    1212            .plugin("html")
    1313            .tap(args => {
    14                 args[0].title = "Korero Maori Transcription Interface";
     14                args[0].title = "Korero Māori Transcription Interface";
    1515                return args;
    1616            })
  • main/trunk/model-interfaces-dev/atea/resources/interface_atea.properties

    r35451 r35454  
    11atea.Title=Korero Māori Transcription Interface
     2atea.Description=A tool to transcribe audio recordings of spoken Māori. Basic support for editing the transcriptions is provided, and they can be downloaded in multiple formats.<br />The actual transcriptions are produced with gratitude by using <a href='https://koreromaori.io'>koreromaori.io</a>'s service.
    23atea.ErrorTryAgain=Something went wrong! Please try again
    34
  • main/trunk/model-interfaces-dev/atea/resources/interface_atea_mi.properties

    r35451 r35454  
    11atea.Title=Atanga Tuhituhi Korero Māori
     2atea.Description=...
    23atea.ErrorTryAgain=Kua he tetahi mea! Tena koa ngana
    34
  • main/trunk/model-interfaces-dev/atea/transform/pages/korero-maori-asr.xsl

    r35448 r35454  
    1616    <xsl:variable name="groupPath"><xsl:value-of select="/page/pageRequest/paramList/param[@name='group']/@value"/></xsl:variable>
    1717    <!-- set page title -->
    18     <xsl:template name="pageTitle">Korero Maori Transcription Interface</xsl:template>
     18    <xsl:template name="pageTitle">
     19        <xsl:value-of disable-output-escaping="yes" select="util:getInterfaceText('atea', /page/@lang, 'atea.Title')"/>
     20    </xsl:template>
    1921
    2022    <!-- set page breadcrumbs -->
Note: See TracChangeset for help on using the changeset viewer.