/hs-nlp

Just some ideas from the CMU NLP course I'm taking, re-implemented in Haskell for my own understanding.

Primary LanguageHaskellMIT LicenseMIT

hs-nlp

Just some ideas from the CMU NLP course I'm taking, re-implemented in Haskell for my own understanding.

Don't expect this to be incredibly useful at the moment -- if there are useful pieces in this that I end up using, I'll probably end up moving them into seperate libraries. This is just a collection of probably fairly naive, innefficent implementations of some of the core NLP algorithms and techniques in Haskell for my own educational purposes.

I'll also store some links/notes/ideas here for my future reference. The following is a bit of a personal "awesome" list of NLP techniques and resources, with a bias towards non-standard language implementations (Haskell, Julia, Rust, Scala, etc...) to explore, and ideas to explore for combining probabalistic / bayesian / machine learning kinds of technqiues with semantic / ontological / logic / type-theory / cateogry-theory sorts of approaches -- as well as with an emphasis on problems I'd like to eventually solve for bedelibry and related personal projects.

But yeah, this is all MIT licensed, so if you find something useful, do what you want with it.

Note that this currently requires --allow-newer in order to run due to the dependency on hmatrix-svdlibc.

General NLP Resources

  • CoreNLP:

    • Implemented in Java
  • Spark NLP:

    • Has a Scala interface. :)
  • GF Word Net

    • This is a pre-existing interlinugal lexicon compatible with GF, which has many possible sense for each given word.

Online Tutorials / Posts / Slide Decks

  • HLearn Bayesian Classifier

    • Super efficent and parallelizable implementation in Haskell.
  • Stop Using word2vec

    • Really easy approach to generating word embeddings. Would be really easy to port over to Haskell -- we could probably use something like repa or massiv to do the calculations.

Interesting Applications

  • Type-Driven Neural Programming by Example
    • This thesis shows an approach of how to structure a neural network for program synthesis-like tasks. A similar structure might be used in order to supply other types of tree-like (strucutred) data as the input or output of a neural net.

Academic Papers

Finite State Transducers

Compositional Semantics and ML

Type-Logical Semantics

Logic and Type Theory

  • Birelational Kripke semantics for an intuitionistic LTL

    • This is more relevant to the work I'm doing in Montague. How do we implement a semantics for tenses? LTL seems like a natural fit.
    • Carpenter actually covers this question in some depth.
  • Concepts in a Probabilistic Language of Thought

    • A fascinating account of how a probabalistic programming langauge (Church) can be used to model "fuzzy" and scientific means of human reasoning, including providing a good account of counterfactuals (especially with some of the issues of typical modeling of counterfactuals as mentioned in Carpenter).
    • There is even an entire book on this topic here, which uses a newer javascript-based version of Church. It would be interesting for Montague to see if we could build something similar to Church as an embedded DSL in Haskell.
  • Logic and pragmatics: Linear logic for inferential practice

    • This paper looks like a very deep application of linear logic to the realm of pragmatics, related to Brandom's work.
    • Although it does not look like it uses typological grammar, I believe it could be applied there.
    • Notably, it looks like tihs make use of the full (i.e. disjunctive and conjunctive, additive and multiplicative) gamut of linear logic connectives.
  • On an intuitionistic logic for pragmatics

    • Similarly to the above, this paper study pragmatics -- however, it makes use of a bi-intuintionistic logic rather than linear logic.
    • This paper is interesting more generally in that apparently it looks at a computational interperation of co-intuitionism in terms of coroutines.

Probabilistic Techniques and Inference

Research Questions

  • Do existing Haskell-based probalisic programming DSLs like monad-bayes have the same capabilities as languages like Church, especially as showcased in languages like "Concepts in a Probabilistic Language of Thought"?

Interesting Techniques

  • Finite State Tree Transducers

    • What sort of NLP tasks might this be good for? What advantage do they have over regular transducers?
  • Scallop

    • A framework integrating differential logic programming with neural networks