Skip to main content

A sentence paraphraser based on dependency syntax and word embeddings

Project description

dependency-paraphraser

A sentence paraphraser based on dependency parsing and word embedding similarity.

The basic usage (for Russian language) is based on Natasha library:

import dependency_paraphraser.natasha
import random
random.seed(1)
# the command below requires additional RAM, but enables synonym replacement
# otherwise, you can support your own w2v model in Gensim format
dependency_paraphraser.natasha.use_news_embeddings()
text = 'Карл у Клары украл кораллы'
for i in range(5):
    print(dependency_paraphraser.natasha.paraphrase(text))
# Карл похитил кораллы у Клары
# украл Карл кораллы у Клары
# украл у Клары Карл кораллы
# Карл отнял у Клары кораллы
# Карл украл кораллы у Клары

Project details


Download files

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

Source Distribution

dependency-paraphraser-0.0.1.tar.gz (27.8 kB view details)

Uploaded Source

File details

Details for the file dependency-paraphraser-0.0.1.tar.gz.

File metadata

  • Download URL: dependency-paraphraser-0.0.1.tar.gz
  • Upload date:
  • Size: 27.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.6

File hashes

Hashes for dependency-paraphraser-0.0.1.tar.gz
Algorithm Hash digest
SHA256 02c3834d2d8ca2fac828793c8c247ac9a5dc3fca495d32bb574d35eebe0a77c4
MD5 f2a7acdee8f09967f27829c46d4d8f5a
BLAKE2b-256 d9ff1f32d66eb0667b9472b25da554d890038ab326a2190a09a7f9ec0333b64e

See more details on using hashes here.

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