Changeset 35389
- Timestamp:
- 2021-09-14T14:09:18+12:00 (3 years ago)
- 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 Setup2 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 install10 ```11 12 - Run Grunt tasks. This performs things like Sass compilation and minification.13 ```14 npx grunt15 ```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 watch20 ```21 22 1 # ASR Development TODO 23 2 -
main/trunk/model-interfaces-dev/atea/korero-maori-asr/README.md
r35355 r35389 7 7 Ensure that [node.js](https://nodejs.org) is on your path. 8 8 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.9 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. 10 10 11 11 ``` … … 15 15 ### Compile and hot-reload for development 16 16 17 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). 18 17 19 ``` 18 20 npm run serve 19 21 ``` 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).22 22 23 23 ### Compile and minify for production … … 25 25 Firstly, development-specific code needs to be changed. 26 26 27 1. In ` AudioUpload.vue#getTranscriptions`27 1. In `TranscribeModule.js` change the `queryUrl` property to point to the primary transcribe endpoint. 28 28 29 29 ```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"; 32 32 ``` 33 33 34 2. In `vue.config.js`, uncomment the `publicPath` property .34 2. 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. 35 35 36 Finally, build the project. 37 38 ``` 39 npm run build 40 ``` 36 3. Finally, build the project. 37 ``` 38 npm run build 39 ``` 41 40 42 41 ### Lint and fix files 43 42 44 This uses the settings in `.eslintrc.js` to lint the project, and fix mistakes accordingly.43 This uses the settings in `.eslintrc.js` to lint the project, and attempts to fix mistakes accordingly. 45 44 46 45 ``` -
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/components/AudioUpload.vue
r35355 r35389 170 170 171 171 try { 172 for await (const batch of transcribeService. testBatchTranscribeFiles(files)) {172 for await (const batch of transcribeService.batchTranscribeFiles(files)) { 173 173 for (const t of batch) { 174 174 if (!t.success) { -
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/js/TranscribeModule.js
r35355 r35389 68 68 constructor() { 69 69 /** @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"; 71 71 72 72 /** @type {Number} The maximum number of files which can be transcribed in one request to the API. */ … … 107 107 yield await this.transcribeFiles(filesToSubmit); 108 108 } 109 }110 111 async* testBatchTranscribeFiles(files) {112 yield fakeTranscriptions;113 109 } 114 110 … … 156 152 } 157 153 } 158 159 // TODO: Figure out some way to map file names here, so that filename mismatches errors are avoided160 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.44169 },170 {171 char: "Ä",172 prob: 0.5,173 start_time: 0.46174 },175 {176 char: " ",177 prob: 0.5,178 start_time: 0.66179 },180 {181 char: "t",182 prob: 0.5,183 start_time: 0.72184 },185 {186 char: "a",187 prob: 0.5,188 start_time: 0.74189 },190 {191 char: "m",192 prob: 0.5,193 start_time: 0.9194 },195 {196 char: "a",197 prob: 0.5,198 start_time: 0.92199 },200 {201 char: " ",202 prob: 0.5,203 start_time: 1.12204 },205 {206 char: "a",207 prob: 0.5,208 start_time: 1.16209 },210 {211 char: " ",212 prob: 0.5,213 start_time: 1.38214 },215 {216 char: "r",217 prob: 0.5,218 start_time: 1.42219 },220 {221 char: "a",222 prob: 0.5,223 start_time: 1.44224 },225 {226 char: "Å",227 prob: 0.5,228 start_time: 1.6229 },230 {231 char: "i",232 prob: 0.5,233 start_time: 1.62234 },235 {236 char: " ",237 prob: 0.5,238 start_time: 1.62239 },240 {241 char: "|",242 prob: 0.5,243 start_time: 0.0244 },245 {246 char: " ",247 prob: 0.5,248 start_time: 0.0249 },250 {251 char: "Å",252 prob: 0.5,253 start_time: 0.44254 },255 {256 char: "Ä",257 prob: 0.5,258 start_time: 0.46259 },260 {261 char: " ",262 prob: 0.5,263 start_time: 0.66264 },265 {266 char: "t",267 prob: 0.5,268 start_time: 0.72269 },270 {271 char: "a",272 prob: 0.5,273 start_time: 0.74274 },275 {276 char: "m",277 prob: 0.5,278 start_time: 0.9279 },280 {281 char: "a",282 prob: 0.5,283 start_time: 0.92284 },285 {286 char: " ",287 prob: 0.5,288 start_time: 1.12289 },290 {291 char: "a",292 prob: 0.5,293 start_time: 1.16294 },295 {296 char: " ",297 prob: 0.5,298 start_time: 1.38299 },300 {301 char: "r",302 prob: 0.5,303 start_time: 1.42304 },305 {306 char: "a",307 prob: 0.5,308 start_time: 1.44309 },310 {311 char: "Å",312 prob: 0.5,313 start_time: 1.6314 },315 {316 char: "i",317 prob: 0.5,318 start_time: 1.62319 },320 {321 char: " ",322 prob: 0.5,323 start_time: 1.62324 },325 {326 char: "|",327 prob: 0.5,328 start_time: 0.0329 },330 {331 char: " ",332 prob: 0.5,333 start_time: 0.0334 },335 {336 char: "Å",337 prob: 0.5,338 start_time: 0.44339 },340 {341 char: "Ä",342 prob: 0.5,343 start_time: 0.46344 },345 {346 char: " ",347 prob: 0.5,348 start_time: 0.66349 },350 {351 char: "t",352 prob: 0.5,353 start_time: 0.72354 },355 {356 char: "a",357 prob: 0.5,358 start_time: 0.74359 },360 {361 char: "m",362 prob: 0.5,363 start_time: 0.9364 },365 {366 char: "a",367 prob: 0.5,368 start_time: 0.92369 },370 {371 char: " ",372 prob: 0.5,373 start_time: 1.12374 },375 {376 char: "a",377 prob: 0.5,378 start_time: 1.16379 },380 {381 char: " ",382 prob: 0.5,383 start_time: 1.38384 },385 {386 char: "r",387 prob: 0.5,388 start_time: 1.42389 },390 {391 char: "a",392 prob: 0.5,393 start_time: 1.44394 },395 {396 char: "Å",397 prob: 0.5,398 start_time: 1.6399 },400 {401 char: "i",402 prob: 0.5,403 start_time: 1.62404 },405 {406 char: " ",407 prob: 0.5,408 start_time: 1.62409 },410 {411 char: "|",412 prob: 0.5,413 start_time: 0.0414 },415 {416 char: " ",417 prob: 0.5,418 start_time: 0.0419 },420 {421 char: "Å",422 prob: 0.5,423 start_time: 0.44424 },425 {426 char: "Ä",427 prob: 0.5,428 start_time: 0.46429 },430 {431 char: " ",432 prob: 0.5,433 start_time: 0.66434 },435 {436 char: "t",437 prob: 0.5,438 start_time: 0.72439 },440 {441 char: "a",442 prob: 0.5,443 start_time: 0.74444 },445 {446 char: "m",447 prob: 0.5,448 start_time: 0.9449 },450 {451 char: "a",452 prob: 0.5,453 start_time: 0.92454 },455 {456 char: " ",457 prob: 0.5,458 start_time: 1.12459 },460 {461 char: "a",462 prob: 0.5,463 start_time: 1.16464 },465 {466 char: " ",467 prob: 0.5,468 start_time: 1.38469 },470 {471 char: "r",472 prob: 0.5,473 start_time: 1.42474 },475 {476 char: "a",477 prob: 0.5,478 start_time: 1.44479 },480 {481 char: "Å",482 prob: 0.5,483 start_time: 1.6484 },485 {486 char: "i",487 prob: 0.5,488 start_time: 1.62489 },490 {491 char: " ",492 prob: 0.5,493 start_time: 1.62494 },495 {496 char: "|",497 prob: 0.5,498 start_time: 0.0499 },500 {501 char: " ",502 prob: 0.5,503 start_time: 0.0504 },505 {506 char: "Å",507 prob: 0.5,508 start_time: 0.44509 },510 {511 char: "Ä",512 prob: 0.5,513 start_time: 0.46514 },515 {516 char: " ",517 prob: 0.5,518 start_time: 0.66519 },520 {521 char: "t",522 prob: 0.5,523 start_time: 0.72524 },525 {526 char: "a",527 prob: 0.5,528 start_time: 0.74529 },530 {531 char: "m",532 prob: 0.5,533 start_time: 0.9534 },535 {536 char: "a",537 prob: 0.5,538 start_time: 0.92539 },540 {541 char: " ",542 prob: 0.5,543 start_time: 1.12544 },545 {546 char: "a",547 prob: 0.5,548 start_time: 1.16549 },550 {551 char: " ",552 prob: 0.5,553 start_time: 1.38554 },555 {556 char: "r",557 prob: 0.5,558 start_time: 1.42559 },560 {561 char: "a",562 prob: 0.5,563 start_time: 1.44564 },565 {566 char: "Å",567 prob: 0.5,568 start_time: 1.6569 },570 {571 char: "i",572 prob: 0.5,573 start_time: 1.62574 },575 {576 char: " ",577 prob: 0.5,578 start_time: 1.62579 },580 {581 char: "|",582 prob: 0.5,583 start_time: 0.0584 },585 {586 char: " ",587 prob: 0.5,588 start_time: 0.0589 },590 {591 char: "Å",592 prob: 0.5,593 start_time: 0.44594 },595 {596 char: "Ä",597 prob: 0.5,598 start_time: 0.46599 },600 {601 char: " ",602 prob: 0.5,603 start_time: 0.66604 },605 {606 char: "t",607 prob: 0.5,608 start_time: 0.72609 },610 {611 char: "a",612 prob: 0.5,613 start_time: 0.74614 },615 {616 char: "m",617 prob: 0.5,618 start_time: 0.9619 },620 {621 char: "a",622 prob: 0.5,623 start_time: 0.92624 },625 {626 char: " ",627 prob: 0.5,628 start_time: 1.12629 },630 {631 char: "a",632 prob: 0.5,633 start_time: 1.16634 },635 {636 char: " ",637 prob: 0.5,638 start_time: 1.38639 },640 {641 char: "r",642 prob: 0.5,643 start_time: 1.42644 },645 {646 char: "a",647 prob: 0.5,648 start_time: 1.44649 },650 {651 char: "Å",652 prob: 0.5,653 start_time: 1.6654 },655 {656 char: "i",657 prob: 0.5,658 start_time: 1.62659 },660 {661 char: " ",662 prob: 0.5,663 start_time: 1.62664 },665 {666 char: "|",667 prob: 0.5,668 start_time: 0.0669 },670 {671 char: " ",672 prob: 0.5,673 start_time: 0.0674 },675 {676 char: "Å",677 prob: 0.5,678 start_time: 0.44679 },680 {681 char: "Ä",682 prob: 0.5,683 start_time: 0.46684 },685 {686 char: " ",687 prob: 0.5,688 start_time: 0.66689 },690 {691 char: "t",692 prob: 0.5,693 start_time: 0.72694 },695 {696 char: "a",697 prob: 0.5,698 start_time: 0.74699 },700 {701 char: "m",702 prob: 0.5,703 start_time: 0.9704 },705 {706 char: "a",707 prob: 0.5,708 start_time: 0.92709 },710 {711 char: " ",712 prob: 0.5,713 start_time: 1.12714 },715 {716 char: "a",717 prob: 0.5,718 start_time: 1.16719 },720 {721 char: " ",722 prob: 0.5,723 start_time: 1.38724 },725 {726 char: "r",727 prob: 0.5,728 start_time: 1.42729 },730 {731 char: "a",732 prob: 0.5,733 start_time: 1.44734 },735 {736 char: "Å",737 prob: 0.5,738 start_time: 1.6739 },740 {741 char: "i",742 prob: 0.5,743 start_time: 1.62744 },745 {746 char: " ",747 prob: 0.5,748 start_time: 1.62749 },750 {751 char: "|",752 prob: 0.5,753 start_time: 0.0754 },755 {756 char: " ",757 prob: 0.5,758 start_time: 0.0759 },760 {761 char: "Å",762 prob: 0.5,763 start_time: 0.44764 },765 {766 char: "Ä",767 prob: 0.5,768 start_time: 0.46769 },770 {771 char: " ",772 prob: 0.5,773 start_time: 0.66774 },775 {776 char: "t",777 prob: 0.5,778 start_time: 0.72779 },780 {781 char: "a",782 prob: 0.5,783 start_time: 0.74784 },785 {786 char: "m",787 prob: 0.5,788 start_time: 0.9789 },790 {791 char: "a",792 prob: 0.5,793 start_time: 0.92794 },795 {796 char: " ",797 prob: 0.5,798 start_time: 1.12799 },800 {801 char: "a",802 prob: 0.5,803 start_time: 1.16804 },805 {806 char: " ",807 prob: 0.5,808 start_time: 1.38809 },810 {811 char: "r",812 prob: 0.5,813 start_time: 1.42814 },815 {816 char: "a",817 prob: 0.5,818 start_time: 1.44819 },820 {821 char: "Å",822 prob: 0.5,823 start_time: 1.6824 },825 {826 char: "i",827 prob: 0.5,828 start_time: 1.62829 },830 {831 char: " ",832 prob: 0.5,833 start_time: 1.62834 },835 {836 char: "|",837 prob: 0.5,838 start_time: 0.0839 },840 {841 char: " ",842 prob: 0.5,843 start_time: 0.0844 }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: false853 }854 ] -
main/trunk/model-interfaces-dev/atea/korero-maori-asr/src/styles/_material.scss
r35383 r35389 7 7 8 8 $primary-bg-color-l1: #249ccf; 9 $primary-bg-color: #2191c0; 9 10 10 11 :root { 11 12 --primary-bg-color-l1: #249ccf; 12 --primary-bg-color: #21 c05e; // #21c05e13 --primary-bg-color: #2191c0; 13 14 14 15 --primary-fg-color: white; … … 33 34 .theme-flat { 34 35 --primary-bg-color: transparent; 35 --primary-fg-color: # 2191c0;36 --primary-fg-color: #{$primary-bg-color}; 36 37 --primary-box-shadow: none; 37 38
Note:
See TracChangeset
for help on using the changeset viewer.