Technologies: F#, .NET Core, Fable
Field: Artificial Intelligence, Natural Language Processing, Functional Programming, Software Engineering
Completed: March 2020
Natural Language Processing Inference Engine was a large third-year group project as part of EE High Level Programming module.
The project was proposed by the team and its (and module) objective was to build a large software application using Microsoft's functional language F# in a .NET Core environment.
Based on our skill sets and interests in the field of Artificial Intelligence, we set out to create an inference logic engine using predicate logic which is a formal logic framework. The software is able
to perform logical reasoning on plaintext English statements by using an internal knowledge bank to infer about the given statement. The project was constructed in two phases: individual and group in line with the marking criteria.
It was divided into four sections: lexer, parser, logic conversion and evaluation.
Individual [F#]: The ultimate aim of the module was to learn the functional paradigm, which varies significantly from traditionally imperative.
It is when the programmer describes a set of transformations that are needed to map a given input into desired output.
At low level it is describing the logic required take the input, applying a set of rules and computing its output.
It is the unique ability of functional languages, such as F#, that can support high-level abstraction which makes complex tasks trivial to program.
I was responsible for delivering the logic conversion pipeline of the project. The aim of my module was to transform the parsed Abstract Syntax Tree (AST) into predicate-logic type statements,
using specific Discriminated Union struct types supported in F#. It was essentially extracting relevant logic statement out of a given statement and assigning labels for logic evaluations.
I got significant exposure to the functional language and had to learn how to apply my lecture learning to our project in a short period of time. Much of my technical learning was manipulating lists which
are extremely popular in F#, however I also used maps and arrays when appropriate. I also learned how to use Expecto test framework to perform unit testing on my module for robustness.
Group [Fable]: Once our individual modules and code were written, we integrated all four parts together to create a smooth pipeline that was able to infer from simple English statements. As we had to
present our project to our supervisor, we designed an Electron Fable application (front-end development) to interact with our back-end modules. This made our project
more accessible and easier to use. My contribution in this phase was mainly to extend my own module and add more functionality such as being able to handle conditional if/then statements which opened possibilities
for more sophisticated logic handling. This helped the team to exceed project expectations. In our final group demo, we received high praise and accolade from our supervisor which has
been an encouraging take away from this project.
Overall, I was very pleased to have chosen this module and project, and it goes without saying an excellent team to do this project. Not only was this my largest software engineering project, it was a chance
to put our creativity and learning from AI into use in a functional environment. Moving forward, my key learnings from this project are:
A link to the project source code and more in-depth explanations on GitHub can be accessed here.