Giter Site home page Giter Site logo

mikahama / syntaxmaker Goto Github PK

View Code? Open in Web Editor NEW
22.0 3.0 4.0 4.27 MB

The NLG tool for Finnish

Home Page: https://mikakalevi.com/nlp/syntax-maker/

License: Apache License 2.0

Python 100.00%
nlg syntax-maker finnish natural-language-generation python-library natural-language-processing surface-realization syntax inflection morphological-generation

syntaxmaker's Introduction

Syntax maker

DOI

The tool NLG tool for Finnish by Mika Hämäläinen

Syntax maker is the natural language generation tool for generating syntactically correct sentences in Finnish automatically. The tool is especially useful in the case of Finnish which has such a high diversity in its morphosyntax. All you need to know are the lemmas and their parts-of-speech and syntax maker will take care of the rest.

For instance, just throw in words rantaleijona, uneksia, korkea and aalto and you will get rantaleijonat uneksivat korkeista aalloista. So you will get the morphology right automatically! Don't believe me? Just take a look at this tutorial to find out how.

Installing

Run

pip install syntaxmaker
python -m uralicNLP.download -l fin

Usage

An example for generating a sentence in Finnish:

from syntaxmaker.syntax_maker import *
vp = create_verb_pharse("antaa")
subject = create_phrase("NP", "hevonen", {"NUM": "PL"})

dobject = create_phrase("NP", "lahja", {"NUM": "PL"})
dobject.components["attribute"] = create_phrase("AP", "mahtava")
dobject.components["attribute"].components["attribute"] = create_phrase("AdvP", "erittäin")

indobject = create_phrase("NP", "lehmä")
vp.components["subject"] = subject
vp.components["dir_object"] = dobject
vp.components["indir_object"] = indobject
print(vp)
>> hevoset antavat erittäin mahtavia lahjoja lehmälle

Go to Creating a sentence, the basics for a quick start guide.

A good source of example code with the expected output can be found in the Travis test file.

Don't forget to read the Wiki for more instructions.

Cite

If you use Syntax Maker in any academic publication, please cite it as follows:

Hämäläinen, Mika and Rueter, Jack 2018. Development of an Open Source Natural Language Generation Tool for Finnish. In Proceedings of the Fourth International Workshop on Computational Linguistics of Uralic Languages, 51–58.

More information?

Just go ahead and take a look at the wiki or my blog post about Syntax maker.

syntaxmaker's People

Contributors

mikahama avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

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.