Skip to content

Commit

Permalink
utseg command
Browse files Browse the repository at this point in the history
  • Loading branch information
Jemoka committed Apr 14, 2024
1 parent 232c050 commit 65c56d3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
19 changes: 19 additions & 0 deletions batchalign/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,25 @@ def writer(doc, output):
in_dir, out_dir,
loader, writer, C)


#################### UTSEG ################################

@batchalign.command()
@common_options
@click.pass_context
def utseg(ctx, in_dir, out_dir, lang, num_speakers, **kwargs):
"""Perform morphosyntactic analysis on transcripts."""

def loader(file):
return CHATFile(path=os.path.abspath(file), special_mor_=True).doc

def writer(doc, output):
CHATFile(doc=doc, special_mor_=True).write(output)

_dispatch("utseg", lang, num_speakers, ["cha"], ctx,
in_dir, out_dir,
loader, writer, C)

#################### BENCHMARK ################################

@batchalign.command()
Expand Down
1 change: 1 addition & 0 deletions batchalign/cli/dispatch.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"transcribe_s": "asr,speaker",
"morphotag": "morphosyntax",
"benchmark": "asr,eval",
"utseg": "utterance",
}

# this is the main runner used by all functions
Expand Down
4 changes: 2 additions & 2 deletions batchalign/version
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
0.7.1-beta.0
0.7.1-beta.1
Apr 13th, 2024
Stanza Utterance Segmenter
utseg command

0 comments on commit 65c56d3

Please sign in to comment.