Changeset 35389


Ignore:
Timestamp:
2021-09-14T14:09:18+12:00 (3 years ago)
Author:
davidb
Message:

Update READMEs.
Revert transcibe test methods following associated servlet fix.

Location:
main/trunk/model-interfaces-dev/atea
Files:
5 edited

Legend:

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

    r35355 r35389  
    1 # ASR Interface Setup
    2 
    3 The ASR interface utilises tools such as [Grunt](https://gruntjs.com), [Sass](https://sass-lang.com) and [Vue](https://vuejs.org). To do this, it requires you have [node.js](https://nodejs.org/) and the `npm` package manager installed.
    4 
    5 To get started:
    6 
    7 - Install any dependencies.
    8     ```
    9     npm install
    10     ```
    11 
    12 - Run Grunt tasks. This performs things like Sass compilation and minification.
    13     ```
    14     npx grunt
    15     ```
    16 
    17 - For development purposes, use the Grunt file watcher to prevent the need to run `grunt` manually each time you change a file.
    18     ```
    19     npx grunt watch
    20     ```
    21 
    221# ASR Development TODO
    232
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/README.md

    r35355 r35389  
    77Ensure that [node.js](https://nodejs.org) is on your path.
    88
    9 For production purposes, or to test in a production environment, you will also need to setup the Greenstone `koreromaori-proxy` extension. Visit https://trac.greenstone.org/browser/gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy to get the source.
     9You will also need to setup the Greenstone `koreromaori-proxy` extension. Visit https://trac.greenstone.org/browser/gs3-extensions/atea-nlp-tools/trunk/src/koreromaori-proxy to get the source.
    1010
    1111```
     
    1515### Compile and hot-reload for development
    1616
     17This will open a development webserver on [localhost:8080](http://localhost:8080), that is detached from the running Greenstone instance (provided you haven't removed development-specific code).
     18
    1719```
    1820npm run serve
    1921```
    20 
    21 This will open a development webserver on [localhost:8080](http://localhost:8080), that is detached from the running Greenstone instance (provided you haven't removed development-specific code).
    2222
    2323### Compile and minify for production
     
    2525Firstly, development-specific code needs to be changed.
    2626
    27 1. In `AudioUpload.vue#getTranscriptions`
     271. In `TranscribeModule.js` change the `queryUrl` property to point to the primary transcribe endpoint.
    2828
    2929    ```js
    30     -- for await (const batch of transcribeService.testBatchTranscribeFiles(files)) {
    31     ++ for await (const batch of transcribeService.batchTranscribeFiles(files)) {
     30    -- this.queryUrl = "//localhost:8383/gs3-koreromaori/transcribe/test";
     31    ++ this.queryUrl = "//localhost:8383/gs3-koreromaori/transcribe";
    3232    ```
    3333
    34 2. In `vue.config.js`, uncomment the `publicPath` property.
     342. In `vue.config.js`, uncomment the `publicPath` property, and optionally change it to point to where your production distribution will be placed relative to the interface.
    3535
    36 Finally, build the project.
    37 
    38 ```
    39 npm run build
    40 ```
     363. Finally, build the project.
     37    ```
     38    npm run build
     39    ```
    4140
    4241### Lint and fix files
    4342
    44 This uses the settings in `.eslintrc.js` to lint the project, and fix mistakes accordingly.
     43This uses the settings in `.eslintrc.js` to lint the project, and attempts to fix mistakes accordingly.
    4544
    4645```
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/AudioUpload.vue

    r35355 r35389  
    170170
    171171    try {
    172         for await (const batch of transcribeService.testBatchTranscribeFiles(files)) {
     172        for await (const batch of transcribeService.batchTranscribeFiles(files)) {
    173173            for (const t of batch) {
    174174                if (!t.success) {
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/js/TranscribeModule.js

    r35355 r35389  
    6868    constructor() {
    6969        /** @type {String} The URL to which query POST requests should be made. */
    70         this.queryUrl = "/gs3-koreromaori/transcribe";
     70        this.queryUrl = "//localhost:8383/gs3-koreromaori/transcribe/test";
    7171
    7272        /** @type {Number} The maximum number of files which can be transcribed in one request to the API. */
     
    107107            yield await this.transcribeFiles(filesToSubmit);
    108108        }
    109     }
    110 
    111     async* testBatchTranscribeFiles(files) {
    112         yield fakeTranscriptions;
    113109    }
    114110
     
    156152    }
    157153}
    158 
    159 // TODO: Figure out some way to map file names here, so that filename mismatches errors are avoided
    160 const fakeTranscriptions = [
    161     {
    162         file_name: "akl_mi_pk_0001.wav",
    163         log: "Generated a mock transcription of akl_mi_pk_0001.wav",
    164         metadata: [
    165             {
    166                 char: "ŋ",
    167                 prob: 0.5,
    168                 start_time: 0.44
    169             },
    170             {
    171                 char: "ā",
    172                 prob: 0.5,
    173                 start_time: 0.46
    174             },
    175             {
    176                 char: " ",
    177                 prob: 0.5,
    178                 start_time: 0.66
    179             },
    180             {
    181                 char: "t",
    182                 prob: 0.5,
    183                 start_time: 0.72
    184             },
    185             {
    186                 char: "a",
    187                 prob: 0.5,
    188                 start_time: 0.74
    189             },
    190             {
    191                 char: "m",
    192                 prob: 0.5,
    193                 start_time: 0.9
    194             },
    195             {
    196                 char: "a",
    197                 prob: 0.5,
    198                 start_time: 0.92
    199             },
    200             {
    201                 char: " ",
    202                 prob: 0.5,
    203                 start_time: 1.12
    204             },
    205             {
    206                 char: "a",
    207                 prob: 0.5,
    208                 start_time: 1.16
    209             },
    210             {
    211                 char: " ",
    212                 prob: 0.5,
    213                 start_time: 1.38
    214             },
    215             {
    216                 char: "r",
    217                 prob: 0.5,
    218                 start_time: 1.42
    219             },
    220             {
    221                 char: "a",
    222                 prob: 0.5,
    223                 start_time: 1.44
    224             },
    225             {
    226                 char: "ŋ",
    227                 prob: 0.5,
    228                 start_time: 1.6
    229             },
    230             {
    231                 char: "i",
    232                 prob: 0.5,
    233                 start_time: 1.62
    234             },
    235             {
    236                 char: " ",
    237                 prob: 0.5,
    238                 start_time: 1.62
    239             },
    240             {
    241                 char: "|",
    242                 prob: 0.5,
    243                 start_time: 0.0
    244             },
    245             {
    246                 char: " ",
    247                 prob: 0.5,
    248                 start_time: 0.0
    249             },
    250             {
    251                 char: "ŋ",
    252                 prob: 0.5,
    253                 start_time: 0.44
    254             },
    255             {
    256                 char: "ā",
    257                 prob: 0.5,
    258                 start_time: 0.46
    259             },
    260             {
    261                 char: " ",
    262                 prob: 0.5,
    263                 start_time: 0.66
    264             },
    265             {
    266                 char: "t",
    267                 prob: 0.5,
    268                 start_time: 0.72
    269             },
    270             {
    271                 char: "a",
    272                 prob: 0.5,
    273                 start_time: 0.74
    274             },
    275             {
    276                 char: "m",
    277                 prob: 0.5,
    278                 start_time: 0.9
    279             },
    280             {
    281                 char: "a",
    282                 prob: 0.5,
    283                 start_time: 0.92
    284             },
    285             {
    286                 char: " ",
    287                 prob: 0.5,
    288                 start_time: 1.12
    289             },
    290             {
    291                 char: "a",
    292                 prob: 0.5,
    293                 start_time: 1.16
    294             },
    295             {
    296                 char: " ",
    297                 prob: 0.5,
    298                 start_time: 1.38
    299             },
    300             {
    301                 char: "r",
    302                 prob: 0.5,
    303                 start_time: 1.42
    304             },
    305             {
    306                 char: "a",
    307                 prob: 0.5,
    308                 start_time: 1.44
    309             },
    310             {
    311                 char: "ŋ",
    312                 prob: 0.5,
    313                 start_time: 1.6
    314             },
    315             {
    316                 char: "i",
    317                 prob: 0.5,
    318                 start_time: 1.62
    319             },
    320             {
    321                 char: " ",
    322                 prob: 0.5,
    323                 start_time: 1.62
    324             },
    325             {
    326                 char: "|",
    327                 prob: 0.5,
    328                 start_time: 0.0
    329             },
    330             {
    331                 char: " ",
    332                 prob: 0.5,
    333                 start_time: 0.0
    334             },
    335             {
    336                 char: "ŋ",
    337                 prob: 0.5,
    338                 start_time: 0.44
    339             },
    340             {
    341                 char: "ā",
    342                 prob: 0.5,
    343                 start_time: 0.46
    344             },
    345             {
    346                 char: " ",
    347                 prob: 0.5,
    348                 start_time: 0.66
    349             },
    350             {
    351                 char: "t",
    352                 prob: 0.5,
    353                 start_time: 0.72
    354             },
    355             {
    356                 char: "a",
    357                 prob: 0.5,
    358                 start_time: 0.74
    359             },
    360             {
    361                 char: "m",
    362                 prob: 0.5,
    363                 start_time: 0.9
    364             },
    365             {
    366                 char: "a",
    367                 prob: 0.5,
    368                 start_time: 0.92
    369             },
    370             {
    371                 char: " ",
    372                 prob: 0.5,
    373                 start_time: 1.12
    374             },
    375             {
    376                 char: "a",
    377                 prob: 0.5,
    378                 start_time: 1.16
    379             },
    380             {
    381                 char: " ",
    382                 prob: 0.5,
    383                 start_time: 1.38
    384             },
    385             {
    386                 char: "r",
    387                 prob: 0.5,
    388                 start_time: 1.42
    389             },
    390             {
    391                 char: "a",
    392                 prob: 0.5,
    393                 start_time: 1.44
    394             },
    395             {
    396                 char: "ŋ",
    397                 prob: 0.5,
    398                 start_time: 1.6
    399             },
    400             {
    401                 char: "i",
    402                 prob: 0.5,
    403                 start_time: 1.62
    404             },
    405             {
    406                 char: " ",
    407                 prob: 0.5,
    408                 start_time: 1.62
    409             },
    410             {
    411                 char: "|",
    412                 prob: 0.5,
    413                 start_time: 0.0
    414             },
    415             {
    416                 char: " ",
    417                 prob: 0.5,
    418                 start_time: 0.0
    419             },
    420             {
    421                 char: "ŋ",
    422                 prob: 0.5,
    423                 start_time: 0.44
    424             },
    425             {
    426                 char: "ā",
    427                 prob: 0.5,
    428                 start_time: 0.46
    429             },
    430             {
    431                 char: " ",
    432                 prob: 0.5,
    433                 start_time: 0.66
    434             },
    435             {
    436                 char: "t",
    437                 prob: 0.5,
    438                 start_time: 0.72
    439             },
    440             {
    441                 char: "a",
    442                 prob: 0.5,
    443                 start_time: 0.74
    444             },
    445             {
    446                 char: "m",
    447                 prob: 0.5,
    448                 start_time: 0.9
    449             },
    450             {
    451                 char: "a",
    452                 prob: 0.5,
    453                 start_time: 0.92
    454             },
    455             {
    456                 char: " ",
    457                 prob: 0.5,
    458                 start_time: 1.12
    459             },
    460             {
    461                 char: "a",
    462                 prob: 0.5,
    463                 start_time: 1.16
    464             },
    465             {
    466                 char: " ",
    467                 prob: 0.5,
    468                 start_time: 1.38
    469             },
    470             {
    471                 char: "r",
    472                 prob: 0.5,
    473                 start_time: 1.42
    474             },
    475             {
    476                 char: "a",
    477                 prob: 0.5,
    478                 start_time: 1.44
    479             },
    480             {
    481                 char: "ŋ",
    482                 prob: 0.5,
    483                 start_time: 1.6
    484             },
    485             {
    486                 char: "i",
    487                 prob: 0.5,
    488                 start_time: 1.62
    489             },
    490             {
    491                 char: " ",
    492                 prob: 0.5,
    493                 start_time: 1.62
    494             },
    495             {
    496                 char: "|",
    497                 prob: 0.5,
    498                 start_time: 0.0
    499             },
    500             {
    501                 char: " ",
    502                 prob: 0.5,
    503                 start_time: 0.0
    504             },
    505             {
    506                 char: "ŋ",
    507                 prob: 0.5,
    508                 start_time: 0.44
    509             },
    510             {
    511                 char: "ā",
    512                 prob: 0.5,
    513                 start_time: 0.46
    514             },
    515             {
    516                 char: " ",
    517                 prob: 0.5,
    518                 start_time: 0.66
    519             },
    520             {
    521                 char: "t",
    522                 prob: 0.5,
    523                 start_time: 0.72
    524             },
    525             {
    526                 char: "a",
    527                 prob: 0.5,
    528                 start_time: 0.74
    529             },
    530             {
    531                 char: "m",
    532                 prob: 0.5,
    533                 start_time: 0.9
    534             },
    535             {
    536                 char: "a",
    537                 prob: 0.5,
    538                 start_time: 0.92
    539             },
    540             {
    541                 char: " ",
    542                 prob: 0.5,
    543                 start_time: 1.12
    544             },
    545             {
    546                 char: "a",
    547                 prob: 0.5,
    548                 start_time: 1.16
    549             },
    550             {
    551                 char: " ",
    552                 prob: 0.5,
    553                 start_time: 1.38
    554             },
    555             {
    556                 char: "r",
    557                 prob: 0.5,
    558                 start_time: 1.42
    559             },
    560             {
    561                 char: "a",
    562                 prob: 0.5,
    563                 start_time: 1.44
    564             },
    565             {
    566                 char: "ŋ",
    567                 prob: 0.5,
    568                 start_time: 1.6
    569             },
    570             {
    571                 char: "i",
    572                 prob: 0.5,
    573                 start_time: 1.62
    574             },
    575             {
    576                 char: " ",
    577                 prob: 0.5,
    578                 start_time: 1.62
    579             },
    580             {
    581                 char: "|",
    582                 prob: 0.5,
    583                 start_time: 0.0
    584             },
    585             {
    586                 char: " ",
    587                 prob: 0.5,
    588                 start_time: 0.0
    589             },
    590             {
    591                 char: "ŋ",
    592                 prob: 0.5,
    593                 start_time: 0.44
    594             },
    595             {
    596                 char: "ā",
    597                 prob: 0.5,
    598                 start_time: 0.46
    599             },
    600             {
    601                 char: " ",
    602                 prob: 0.5,
    603                 start_time: 0.66
    604             },
    605             {
    606                 char: "t",
    607                 prob: 0.5,
    608                 start_time: 0.72
    609             },
    610             {
    611                 char: "a",
    612                 prob: 0.5,
    613                 start_time: 0.74
    614             },
    615             {
    616                 char: "m",
    617                 prob: 0.5,
    618                 start_time: 0.9
    619             },
    620             {
    621                 char: "a",
    622                 prob: 0.5,
    623                 start_time: 0.92
    624             },
    625             {
    626                 char: " ",
    627                 prob: 0.5,
    628                 start_time: 1.12
    629             },
    630             {
    631                 char: "a",
    632                 prob: 0.5,
    633                 start_time: 1.16
    634             },
    635             {
    636                 char: " ",
    637                 prob: 0.5,
    638                 start_time: 1.38
    639             },
    640             {
    641                 char: "r",
    642                 prob: 0.5,
    643                 start_time: 1.42
    644             },
    645             {
    646                 char: "a",
    647                 prob: 0.5,
    648                 start_time: 1.44
    649             },
    650             {
    651                 char: "ŋ",
    652                 prob: 0.5,
    653                 start_time: 1.6
    654             },
    655             {
    656                 char: "i",
    657                 prob: 0.5,
    658                 start_time: 1.62
    659             },
    660             {
    661                 char: " ",
    662                 prob: 0.5,
    663                 start_time: 1.62
    664             },
    665             {
    666                 char: "|",
    667                 prob: 0.5,
    668                 start_time: 0.0
    669             },
    670             {
    671                 char: " ",
    672                 prob: 0.5,
    673                 start_time: 0.0
    674             },
    675             {
    676                 char: "ŋ",
    677                 prob: 0.5,
    678                 start_time: 0.44
    679             },
    680             {
    681                 char: "ā",
    682                 prob: 0.5,
    683                 start_time: 0.46
    684             },
    685             {
    686                 char: " ",
    687                 prob: 0.5,
    688                 start_time: 0.66
    689             },
    690             {
    691                 char: "t",
    692                 prob: 0.5,
    693                 start_time: 0.72
    694             },
    695             {
    696                 char: "a",
    697                 prob: 0.5,
    698                 start_time: 0.74
    699             },
    700             {
    701                 char: "m",
    702                 prob: 0.5,
    703                 start_time: 0.9
    704             },
    705             {
    706                 char: "a",
    707                 prob: 0.5,
    708                 start_time: 0.92
    709             },
    710             {
    711                 char: " ",
    712                 prob: 0.5,
    713                 start_time: 1.12
    714             },
    715             {
    716                 char: "a",
    717                 prob: 0.5,
    718                 start_time: 1.16
    719             },
    720             {
    721                 char: " ",
    722                 prob: 0.5,
    723                 start_time: 1.38
    724             },
    725             {
    726                 char: "r",
    727                 prob: 0.5,
    728                 start_time: 1.42
    729             },
    730             {
    731                 char: "a",
    732                 prob: 0.5,
    733                 start_time: 1.44
    734             },
    735             {
    736                 char: "ŋ",
    737                 prob: 0.5,
    738                 start_time: 1.6
    739             },
    740             {
    741                 char: "i",
    742                 prob: 0.5,
    743                 start_time: 1.62
    744             },
    745             {
    746                 char: " ",
    747                 prob: 0.5,
    748                 start_time: 1.62
    749             },
    750             {
    751                 char: "|",
    752                 prob: 0.5,
    753                 start_time: 0.0
    754             },
    755             {
    756                 char: " ",
    757                 prob: 0.5,
    758                 start_time: 0.0
    759             },
    760             {
    761                 char: "ŋ",
    762                 prob: 0.5,
    763                 start_time: 0.44
    764             },
    765             {
    766                 char: "ā",
    767                 prob: 0.5,
    768                 start_time: 0.46
    769             },
    770             {
    771                 char: " ",
    772                 prob: 0.5,
    773                 start_time: 0.66
    774             },
    775             {
    776                 char: "t",
    777                 prob: 0.5,
    778                 start_time: 0.72
    779             },
    780             {
    781                 char: "a",
    782                 prob: 0.5,
    783                 start_time: 0.74
    784             },
    785             {
    786                 char: "m",
    787                 prob: 0.5,
    788                 start_time: 0.9
    789             },
    790             {
    791                 char: "a",
    792                 prob: 0.5,
    793                 start_time: 0.92
    794             },
    795             {
    796                 char: " ",
    797                 prob: 0.5,
    798                 start_time: 1.12
    799             },
    800             {
    801                 char: "a",
    802                 prob: 0.5,
    803                 start_time: 1.16
    804             },
    805             {
    806                 char: " ",
    807                 prob: 0.5,
    808                 start_time: 1.38
    809             },
    810             {
    811                 char: "r",
    812                 prob: 0.5,
    813                 start_time: 1.42
    814             },
    815             {
    816                 char: "a",
    817                 prob: 0.5,
    818                 start_time: 1.44
    819             },
    820             {
    821                 char: "ŋ",
    822                 prob: 0.5,
    823                 start_time: 1.6
    824             },
    825             {
    826                 char: "i",
    827                 prob: 0.5,
    828                 start_time: 1.62
    829             },
    830             {
    831                 char: " ",
    832                 prob: 0.5,
    833                 start_time: 1.62
    834             },
    835             {
    836                 char: "|",
    837                 prob: 0.5,
    838                 start_time: 0.0
    839             },
    840             {
    841                 char: " ",
    842                 prob: 0.5,
    843                 start_time: 0.0
    844             }
    845         ],
    846         success: true,
    847         transcription: "ngā tama a rangi | ngā tama a rangi | ngā tama a rangi | ngā tama a rangi | ngā tama a rangi | ngā tama a rangi | ngā tama a rangi | ngā tama a rangi | "
    848     },
    849     {
    850         file_name: "id10t.wav",
    851         log: "Ruh roh!",
    852         success: false
    853     }
    854 ]
  • main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/styles/_material.scss

    r35383 r35389  
    77
    88$primary-bg-color-l1: #249ccf;
     9$primary-bg-color: #2191c0;
    910
    1011:root {
    1112    --primary-bg-color-l1: #249ccf;
    12     --primary-bg-color: #21c05e; // #21c05e
     13    --primary-bg-color: #2191c0;
    1314
    1415    --primary-fg-color: white;
     
    3334.theme-flat {
    3435    --primary-bg-color: transparent;
    35     --primary-fg-color: #2191c0;
     36    --primary-fg-color: #{$primary-bg-color};
    3637    --primary-box-shadow: none;
    3738
Note: See TracChangeset for help on using the changeset viewer.