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

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file subtree_metric-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: subtree_metric-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 6.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.3.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

File hashes

Hashes for subtree_metric-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 57e0d216314041e6af8249269776bcab1336c790d1f0d81c4fd4d7d24bfc82e1
MD5 a2e5cc7b6a0b7bc70e021a1cbe272d7d
BLAKE2b-256 b470e85ec995e4c7d3daa9f990a2c5a2da25dd5b5e59cea68990f554910186fc

See more details on using hashes here.

Supported by

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