Coder Social home page Coder Social logo

turbopape / postagga Goto Github PK

View Code? Open in Web Editor NEW
159.0 18.0 16.0 18.08 MB

A Library to parse natural language in pure Clojure and ClojureScript

License: MIT License

Clojure 100.00%
natural-language-processing clojure clojurescript pos-tagger parser viterbi-algorithm bots

postagga's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @turbopape
  • ๐Ÿ‘€ Iโ€™m interested in software, music and literature
  • ๐ŸŒฑ Iโ€™m currently learning to live on my own while launching automagic tools
  • ๐Ÿ“ซ How to reach me: book 30 mins with me or send me an email

postagga's People

Contributors

asood123 avatar attil-io avatar dmatysiak avatar elyes91 avatar jeffbirkholz avatar madstap avatar milt avatar oylenshpeegul avatar turbopape avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

postagga's Issues

Feature Request: OR logic for rule steps

Thanks for the great work so far on this, I'm having a blast trying it out. One thing I'd love to see is a way to express that one of a group of steps is required, rather than just a list of optional steps.

For instance, I have this working rule:

(def rules [{:id :statement
             :optional-steps []
             :rule [:actor
                    #{:get-value
                      #{"NN"} #{"NNP"} ;; singular, singular proper
                      #{"NNS"} #{"NNPS"}} ;; plural, plural proper
                    :verb
                    #{:get-value #{"VBD"}}
                    :object
                    #{:get-value
                      #{"NN"} #{"NNP"}
                      #{"NNS"} #{"NNPS"}}
                    #{#{"."}}
                    ]}])

"bob experienced enlightenment." => {:errors nil, :result {:rule :statement, :data {:actor ["bob"], :verb ["experienced"], :object ["enlightenment"]}}}

"people experienced enlightenment." => {:errors nil, :result {:rule :statement, :data {:actor ["people"], :verb ["experienced"], :object ["enlightenment"]}}}

note that some of the POS tags are different than the postagga defaults, I'm plugging in the Stanford NLP lib for tagging

This rule finds simple statements of actor - verb - object, where the actor and object can both be singular or plural. But it isn't possible to disambiguate between singular and plural in the result map, meaning that if I want to look specifically for singular or plural actors or objects, I need to either make both optional (which could result in a false hit with no actor/object), or branch and write more rules to cover all cases (singular actor - verb - singular object, plural actor - verb - singular object etc...) which would get pretty huge.

It would be great if I could specify something like an OR condition, either in the optional steps vector or the body of the rule, for example:

(def desired-rules
  [{:id :statement
    :optional-steps [;; grouping of two or more steps to indicate
                     ;; that one of them is required
                     [:actor-singular
                      :actor-plural]
                     ]
    :rule [:actor-singular
           #{:multi :get-value
             #{"NN"} #{"NNP"}} ;; singular, singular proper
           :actor-plural
           #{:multi :get-value
             #{"NNS"} #{"NNPS"}} ;; plural, plural proper
           :verb
           #{:get-value #{"VBD"}}
           :object
           #{:get-value
             #{"NN"} #{"NNP"}
             #{"NNS"} #{"NNPS"}}
           #{#{"."}}
           ]}])

"bob experienced enlightenment." => {:errors nil, :result {:rule :statement, :data {:actor-singular ["bob"], :verb ["experienced"], :object ["enlightenment"]}}}

"people experienced enlightenment." => {:errors nil, :result {:rule :statement, :data {:actor-plural ["people"], :verb ["experienced"], :object ["enlightenment"]}}}

Would something like this make sense to add? Is there some other property of the rule syntax that can achieve this already? Happy to contribute to make it happen.

Use external POS-Taggers into the parser

It might be interesting for people to add and document how they could add their POS-Taggers.
I red somewhere someone was able to use Standford's (see #13 ), it might be great if you can document this !

Create a "little rapper Logo" for postagga !

Postagga the name is a play on "POS-Tagger" mouthed as "gangsta"... etc.
As it is a lib about words and language, I thought it pertains the Rap culture, and so the name was picked.
To reflect that, postagga can use a logo showing a little comics-y rapper, that'd reflect its friendliness as welle as its toughness with words !

Typo in website URL

First of all thanks for this library, it looks great!

Just a typo: http://fekr.tech seems wrong, it should be http://www.fekr.tech instead.

Include complete examples

It would be beneficial for beginner users to have a complete running example programs, preferably in English.

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.