-
Notifications
You must be signed in to change notification settings - Fork 0
/
metadata.py
56 lines (48 loc) · 2.3 KB
/
metadata.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
"""
The purpose of this file is to define the metadata of the app with minimal imports.
DO NOT CHANGE the name of the file
"""
from lapps.discriminators import Uri
from mmif import DocumentTypes, AnnotationTypes
from clams.app import ClamsApp
from clams.appmetadata import AppMetadata
timeunit = 'milliseconds'
# DO NOT CHANGE the function name
def appmetadata() -> AppMetadata:
"""
Function to set app-metadata values and return it as an ``AppMetadata`` obj.
Read these documentations before changing the code below
- https://sdk.clams.ai/appmetadata.html metadata specification.
- https://sdk.clams.ai/autodoc/clams.appmetadata.html python API
:return: AppMetadata object holding all necessary information.
"""
metadata = AppMetadata(
name="AAPB-PUA Kaldi Wrapper",
description="A CLAMS wrapper for Kaldi-based ASR software originally developed by PopUpArchive and hipstas, "
"and later updated by Kyeongmin Rim at Brandeis University. Wrapped software can be "
"found at https://github.com/brandeis-llc/aapb-pua-kaldi-docker . ",
app_license="Apache 2.0",
identifier=f"aapb-pua-kaldi-wrapper",
url="https://github.com/clamsproject/app-aapb-pua-kaldi-wrapper",
analyzer_version="v4",
analyzer_license="UNKNOWN",
)
metadata.add_input_oneof(DocumentTypes.AudioDocument, DocumentTypes.VideoDocument)
metadata.add_output(DocumentTypes.TextDocument)
metadata.add_output(AnnotationTypes.TimeFrame, timeUnit=timeunit)
metadata.add_output(AnnotationTypes.Alignment)
metadata.add_output(Uri.TOKEN)
metadata.add_parameter(name="use_speech_segmentation",
type="boolean",
description="When true, the app looks for existing TimeFrame with { \"frameType\": "
"\"speech\" } annotations, and runs ASR only on those frames, instead of "
"entire audio files.",
default="true")
return metadata
# DO NOT CHANGE the main block
if __name__ == '__main__':
import sys
metadata = appmetadata()
for param in ClamsApp.universal_parameters:
metadata.add_parameter(**param)
sys.stdout.write(metadata.jsonify(pretty=True))