Skip to main content

Subtree Metric for the translation evaluation

Project description

Subtree Metric Package

This package provides an NLTK-like interface to measure the STM score of the given hypothesis and ideal translations.

There is also a web-app available with a GUI which includes the metrics provided in this package.

URL: http://nlp-metrics.herokuapp.com

Usage example

import spacy
from subtree_metric import stm

nlp: spacy.Language = spacy.load('en_core_web_md')
ref = 'It is a guide to action that ensures that the military will forever heed Party commands'
hyp = 'It is a guide to action which ensures that the military always obeys the commands of the party'
print(stm.sentence_stm(ref,
                       hyp,
                       nlp))

ref = 'It is a guide to action that ensures that the military will forever heed Party commands'
hyp = 'It is to insure the troops forever hearing the activity guidebook that party direct'
print(stm.sentence_stm(ref,
                       hyp,
                       nlp))

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

subtree_metric-0.2.4-py3-none-any.whl (6.9 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page