All Projects → ParhamP → Natural_logic_interpreter

ParhamP / Natural_logic_interpreter

Licence: mit
Automatically interpret and validate nested natural logic arguments based on rules of inference and propositional logic

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Natural logic interpreter

Mlsql
inferring sql queries from plain-text questions about tables
Stars: ✭ 841 (+664.55%)
Mutual labels:  natural-language
When
A natural language date/time parser with pluggable rules
Stars: ✭ 1,113 (+911.82%)
Mutual labels:  natural-language
Forte
Forte is a flexible and powerful NLP builder FOR TExt. This is part of the CASL project: http://casl-project.ai/
Stars: ✭ 89 (-19.09%)
Mutual labels:  natural-language
Wikisql
A large annotated semantic parsing corpus for developing natural language interfaces.
Stars: ✭ 965 (+777.27%)
Mutual labels:  natural-language
Shift Ctrl F
🔎 Search the information available on a webpage using natural language instead of an exact string match.
Stars: ✭ 1,023 (+830%)
Mutual labels:  natural-language
Rasa nlu chi
Turn Chinese natural language into structured data 中文自然语言理解
Stars: ✭ 1,166 (+960%)
Mutual labels:  natural-language
Ring
Innovative and practical general-purpose multi-paradigm language
Stars: ✭ 716 (+550.91%)
Mutual labels:  natural-language
Node Sdk
☄️ Node.js library to access IBM Watson services.
Stars: ✭ 1,471 (+1237.27%)
Mutual labels:  natural-language
Bert In Production
A collection of resources on using BERT (https://arxiv.org/abs/1810.04805 ) and related Language Models in production environments.
Stars: ✭ 58 (-47.27%)
Mutual labels:  natural-language
Stemmer
Fast Porter stemmer implementation
Stars: ✭ 86 (-21.82%)
Mutual labels:  natural-language
Coursera Natural Language Processing Specialization
Programming assignments from all courses in the Coursera Natural Language Processing Specialization offered by deeplearning.ai.
Stars: ✭ 39 (-64.55%)
Mutual labels:  natural-language
Ludwig
Data-centric declarative deep learning framework
Stars: ✭ 8,018 (+7189.09%)
Mutual labels:  natural-language
Cognitive Social Crm
An application that monitors a Twitter feed and determines customer sentiment using IBM Watson Assistant, Tone Analyzer, Natural Language Understanding, as well as CloudantDB
Stars: ✭ 71 (-35.45%)
Mutual labels:  natural-language
Grazi
Grammar checking and more for IntelliJ IDEA
Stars: ✭ 32 (-70.91%)
Mutual labels:  natural-language
Tagan
An official PyTorch implementation of the paper "Text-Adaptive Generative Adversarial Networks: Manipulating Images with Natural Language", NeurIPS 2018
Stars: ✭ 97 (-11.82%)
Mutual labels:  natural-language
Vim Grammarous
A powerful grammar checker for Vim using LanguageTool.
Stars: ✭ 780 (+609.09%)
Mutual labels:  natural-language
Text Analytics With Python
Learn how to process, classify, cluster, summarize, understand syntax, semantics and sentiment of text data with the power of Python! This repository contains code and datasets used in my book, "Text Analytics with Python" published by Apress/Springer.
Stars: ✭ 1,132 (+929.09%)
Mutual labels:  natural-language
Getlang
Natural language detection package in pure Go
Stars: ✭ 110 (+0%)
Mutual labels:  natural-language
Assistantjs
TypeScript framework to build cross-platform voice applications (alexa, google home, ...).
Stars: ✭ 100 (-9.09%)
Mutual labels:  natural-language
Retext Simplify
plugin to check phrases for simpler alternatives
Stars: ✭ 81 (-26.36%)
Mutual labels:  natural-language

Natural_Logic_Interpreter

Description

Natural Logic Interpreter automatically interprets and validates nested natural logical arguments (logical arguments expressed in natural language) based on rules of inference and propositional logic. The program uses "divide and conquer" algorithms implemented by recursive functions to go through nested logical arguments and to be able to define and validate them accordingly.

Inspiration

"Translating sentences in English (or other natural languages) into logical expressions is a crucial task in mathematics, logic programming, artificial intelligence, software engineering, and many other disciplines."

I came across this paragraph while studying "Discrete Mathematics and It's Applications"; therefore, I got inspired to automate this task using computers.

Examples

We can establish these logical arguments:

(I go to school) AND ((I study) AND (I exercise))

IF (I exercise) THEN (I'm healthy)

IF (I'm healthy) THEN (NOT I'm sick)

(I study) OR (I'm sick)

(NOT it rains today)

(I study) AND ((I go to gym) OR (I drink a coffee))

(it rains today) OR ((I exercise) AND (I study))

IF (I'm healthy) THEN (I'm happy) OR (I'm fit)

Then we can validate any proposition we want based on them:

(I'm sick) -----> False

IF (I exercise) THEN (I'm healthy) -----> True

(it rains today) OR ((I exercise) AND (I study)) -----> True

(It rains today) OR (I'm healthy) -----> True

(I drink a coffee) AND ((I'm happy) OR (I'm fit)) -----> None

We can also see all the conclusions that were able to be drawn by the program:

(It rains today) ---> None

(I go to gym) OR (I drink a coffee) ---> None

(I'm happy) ---> None

(I drink a coffee) AND ((I'm happy) OR (I'm fit)) ---> None

(It rains today) OR (I'm healthy) ---> True

(I study) AND ((I go to gym) OR (I drink a coffee)) ---> True

IF (I'm healthy) THEN (NOT I'm sick) ---> True

IF (I'm healthy) THEN (I'm happy) OR (I'm fit) ---> True

(I'm fit) ---> None

(I study) OR (I'm sick) ---> True

(I go to school) AND ((I study) AND (I exercise)) ---> True

(I go to school) ---> True

(it rains today) OR ((I exercise) AND (I study)) ---> True

(I exercise) AND (I study) ---> True

(I'm healthy) ---> True

IF (I exercise) THEN (I'm healthy) ---> True

(I go to gym) ---> None

(I'm happy) OR (I'm fit) ---> None

(I study) AND (I exercise) ---> True

(I drink a coffee) ---> None

(I exercise) ---> True

(it rains today) ---> False

(I'm sick) ---> False

(I study) ---> True

Dependencies

Python 3.5

Install and Usage

Download or clone the repo and click on the executable python file called "NLI" to enter an interactive command line interface.

Syntax Conventions

This is how various expressions should be entered in this program:

Simple expressions: (expression)

AND arguments: (expression1) AND (expression2)

OR arguments: (expression1) OR (expression2)

NOT arguments: (NOT expression)

Conditional arguments: IF (expression1) THEN (expression2)

Current Known Bugs and Limitations

The regex that is written to recognize the type of arguments sometimes fails to do so when the depth or length of main logical arguments becomes large. However, there has not been any known issues when working with arguments similar to the ones seen in the Examples section.

In addition, NOT operation for now cannot be used in the following ways:

These need to be implemented using De Morgan's Law

NOT (expression1) AND (expression2)

NOT (Expression1) OR (expression2)

The author is working on these issues.

Contributing

This field of study is huge and this program is not complete by any means. There is a lot that can be done to add on its capabilities. Please feel free to contribute and build on top of it. Should you have any questions in order to start email me at: [email protected]ail.com.

Author

Parham Pourdavood

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].