All Projects → rawlins → lambda-notebook

rawlins / lambda-notebook

Licence: BSD-3-Clause license
Lambda Notebook: Formal Semantics in Jupyter

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to lambda-notebook

event-embedding-multitask
*SEM 2018: Learning Distributed Event Representations with a Multi-Task Approach
Stars: ✭ 22 (+37.5%)
Mutual labels:  semantics, linguistics
pfootprint
Political Discourse Analysis Using Pre-Trained Word Vectors.
Stars: ✭ 20 (+25%)
Mutual labels:  semantics, linguistics
WonderfulPolishLanguage
This is a repository created for the list of resources for learning and exploring Wonderful Polish language.
Stars: ✭ 31 (+93.75%)
Mutual labels:  linguistics
CommonCoreOntologies
The Common Core Ontology Repository holds the current released version of the Common Core Ontology suite.
Stars: ✭ 109 (+581.25%)
Mutual labels:  semantics
feminizator.github.io
Феминизатор слов
Stars: ✭ 29 (+81.25%)
Mutual labels:  linguistics
BOHM1.1
Bologna Optimal Higher-Order Machine, Version 1.1
Stars: ✭ 45 (+181.25%)
Mutual labels:  lambda-calculus
score-zeroshot
Semantically consistent regularizer for zero-shot learning
Stars: ✭ 65 (+306.25%)
Mutual labels:  semantics
Go101
An online book focusing on Go syntax/semantics and runtime related things
Stars: ✭ 4,128 (+25700%)
Mutual labels:  semantics
lingtypology
R package for linguistic cartography and typological databases search
Stars: ✭ 47 (+193.75%)
Mutual labels:  linguistics
lambda-zero
A minimalist pure lazy functional programming language
Stars: ✭ 65 (+306.25%)
Mutual labels:  lambda-calculus
gidti
Book: Gentle Introduction to Dependent Types with Idris
Stars: ✭ 70 (+337.5%)
Mutual labels:  lambda-calculus
pylangacq
Language Acquisition Research Tools
Stars: ✭ 33 (+106.25%)
Mutual labels:  linguistics
nyt-first-said
Tweets when words are published for the first time in the NYT
Stars: ✭ 222 (+1287.5%)
Mutual labels:  linguistics
StepULC
Efficient and single-steppable ULC evaluation algorithm
Stars: ✭ 15 (-6.25%)
Mutual labels:  lambda-calculus
abella
An interactive theorem prover based on lambda-tree syntax
Stars: ✭ 81 (+406.25%)
Mutual labels:  lambda-calculus
Datasets
🎁 3,000,000+ Unsplash images made available for research and machine learning
Stars: ✭ 1,805 (+11181.25%)
Mutual labels:  semantics
grasp
Essential NLP & ML, short & fast pure Python code
Stars: ✭ 58 (+262.5%)
Mutual labels:  semantics
poesy
Poetic processing, for Python.
Stars: ✭ 28 (+75%)
Mutual labels:  linguistics
koika
A core language for rule-based hardware design 🦑
Stars: ✭ 103 (+543.75%)
Mutual labels:  semantics
proiel-treebank
Official releases of the PROIEL treebank of ancient Indo-European languages
Stars: ✭ 30 (+87.5%)
Mutual labels:  linguistics

Lambda Notebook: Formal Semantics with Jupyter and Python

This project is a framework for linguists and especially semanticists developing analyses in compositional semantics. It aims to provide a means of developing 'digital fragments', following from the method of fragments in Montague grammar.

The project is in an alpha state. While code is publicly up on github, expect bugs and rapid (or occasionally, not-so-rapid) changes. Contributions, requests, and suggestions are welcome. To see an example, a pre-rendered demo notebook can be found at http://nbviewer.jupyter.org/github/rawlins/lambda-notebook/blob/master/notebooks/Lambda%20Notebook%20Demo%20%28executed%29.ipynb.

The lead developer for this project is Kyle Rawlins, kgr at jhu dot edu. I'm an associate professor in the Cognitive Science Department at Johns Hopkins University, and I do both theoretical linguistic semantics and more computational semantics. My eventual goal is for any theoretical linguistics I do to come with a lambda notebook file. (I'm a long way from that dream.)

While this repository comes with many demo and documentation notebooks, they are mostly saved unexecuted. If you would like to see some samples in nbviewer without downloading anything, the notebook-collection repository mirrors the (non-documentation) notebooks, but they are all pre-executed. Here are four samples. The SVG MathJax renderer is highly recommended for viewing any of these (to select it, right click on any formula).

Installation

See https://github.com/rawlins/lambda-notebook/wiki/Installation

Basically,

  • current release: install from PyPI. (pip install lambda-notebook.)
  • current development version: download the repository and ensure you have Jupyter installed (probably via anaconda). Run ./install_lambda_kernel.py.

Getting started

To run the notebook relative to the repository file structure:

  • On a mac, double click lambda_notebook.command.
  • Or, from a shell, run lambda_notebook.py. On windows you may need to explicitly call something like python3 lambda_notebook.py.
  • To user a notebook directory other than the default notebooks, you can call something like ./lambda_notebook.py --notebook-dir=~/Documents/notebooks/. I recommend not keeping your working notebooks in the repository copy.
  • Once the lambda-notebook kernel is installed, you can open lambda notebook files from any instance of Jupyter Notebook.

This will start a server in the terminal and open your web browser to the notebook directory. Then, look through the various notebooks to see examples of what can be done. I recommend starting (for now) with:

  • Lambda Notebook Intro (start here).ipynb
  • Lambda Notebook Demo.ipynb
  • look through the various fragments and tutorials

To stop the server from a terminal, hit Ctrl-C twice in the terminal window. (To stop it from the 0.5 app, hit "Cancel".)

Upgrading

In most instances, you can upgrade by simply downloading a new repository version and running the lambda notebook from within there (or, minimally, running install_lambda_kernel.py from the new repository). Your old notebooks will typically work -- the notebook format is forward compatible, and I try to avoid metalanguage regressions, but because of the alpha state, the API may change. (There may be metalanguage changes before beta, though.)

A note on the lambda notebook UI

  • Lambda notebook is running within the Jupyter notebook framework, and inherits much of the AI. It works in either classic notebook mode or in jupyter lab.
  • Jupyter UI is modal; this can take some getting used to if you aren't familiar with modal editors such as vi. Basically, you are either in edit mode (for editing cells) or command mode (for running cells). Use Enter/esc (or mouse click inside/outside of an edit area) to switch between those. There will be a little pen marker in the upper right corner if you are in edit mode, and the selected cell border will be green. If something isn't doing what you expect, check if you are in the correct mode.
  • Try running through the UI tour (from the help menu of any notebook) to get a sense of the Jupyter UI.

Code overview

There are three main parts to the code, structured into meta.py ("meta" for metalanguage), types.py, and lang.py.

  • meta.py and types.py together provide a typed logical metalanguage somewhat comparable to nltk.sem.
  • lang.py provides machinery for doing composition on an object language.

Two additional files, magics.py and parsing.py provide support for using cell magics in the notebook to directly type expressions in the metalanguage. See the notebooks for demos of what this looks like; better documentation coming soon!

NLTK

The file tree_mini.py provides nltk.tree, modified to work with the lambda notebook. The long-term plan is to depend directly on nltk, but this isn't there yet.

See here for NLTK license information (Apache license).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].