Giter Club home page Giter Club logo

inflex's Introduction

Inflex

Natural Language Inflection in English
(Formerly called Inflexion)

Overview

The Inflex module is a rule-based morphological analyser and generator. It allows for conversions of any noun, verb or adjective to a specific wordform such as singular, plural, past, past participle or present participle.

Inflex can be tried out and compared against competitors including nltk, textblob, pattern, inflect, inflection, inflector, lemminflect, and pyinflect on https://www.tomaarsen.com/projects/inflex/try. Furthermore, the comparison of performance of all of these modules is visualised on https://www.tomaarsen.com/projects/inflex/performance, using several different datasets. These results show that Inflex outperforms all existing modules for noun conversions, and performs competitively for verbs. This website also contains the thesis out of which Inflex (formerly called Inflexion) was born.

The Inflex documentation can be found here, alongside a Quick Reference.

Sample Usage

To give a quick idea of this project, this is an example usage of Inflex:

from inflex import Noun, Verb, Adjective

# Converting Nouns
Noun("book").plural()   # Produces "books"
Noun("book").singular() # Produces "book"

# Converting Verbs
Verb("fly").plural()    # Produces "fly"
Verb("fly").singular()  # Produces "flies"
Verb("fly").past()      # Produces "flew"
Verb("fly").pres_part() # Produces "flying"
Verb("fly").past_part() # Produces "flown"

# Converting Adjectives
Adjective("my").singular()       # Produces "my"
Adjective("our").plural()        # Produces "our"
Adjective("small").comparative() # Produces "smallest"
Adjective("small").superlative() # Produces "smaller"

Install

Inflex has no requirements, and has support for Python version 3.6 onwards.
Install it via:

pip install inflex

inflex's People

Contributors

tomaarsen avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

inflex's Issues

Add support for converting a part of speech into another

@tomaarsen Friendly ping!

For example:
Verb to noun:
die -> death

Adjective to adverb:
Beautiful -> beautifully

Make it happen, please!!
My project would benefit a lot from those abilities :)

Your library has the potential to become a cornerstone of NLU and NLG projects, pushing back the frontier of what can be achieved.

Side note: Did it ever occur to you that your project is the inverse function of a lemnatizer? Kinda obvious in retrospect but maybe there are (or not) insights to derive from this and from the methods of state of the art lemnatizer s.
In other words, i expect a SOTA lemnatizer to have some "understanding" of inflexions in order to reverse them accurately (contrary to a word stemmer), and this might slightly overlap with relevant algorithms for your Inflector.

a function to align two words

I want to align two words, ie. if I have challenges, I pass question to this alignment function it would generate questions.

Is this something within the scope of this library?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.