Usage ExampleΒΆ

To use, you can use the tde/eval.py script:

python eval.py discovered_class corpus output/

or you can use the API in python

import pkg_resources
from tde.readers.gold_reader import *
from tde.readers.disc_reader import *
wrd_path = pkg_resources.resource_filename(
            pkg_resources.Requirement.parse('tde'),
            'tde/share/mandarin.wrd')
phn_path = pkg_resources.resource_filename(
            pkg_resources.Requirement.parse('tde'),
            'tde/share/mandarin.phn')

gold = Gold(wrd_path=wrd_path,
                phn_path=phn_path)

disc_clsfile = "/path/to/discovered/file"

disc = Disc(disc_clsfile, gold)

from tde.measures.grouping import *
grouping = Grouping(discovered)
grouping.compute_grouping()

print(grouping.precision)
print(grouping.recall)