Skip to main content

NLU

The NLU (Natural Language Unit) lies at the heart of EASEx and is responsible for the following processes:

Python Parsing

The NLU has a built-in python parser that can extract all modules and functions used in a python script. The parser works primarily by analyzing the AST (abstract syntax tree) generated by the interpreter.

For example, the following code is resolved into:

import matplotlib.pyplot as plt
plt.plot()
import seaborn
seaborn.__version__()
from matplotlib.pyplot import plot
plot()
"modules": [
{"name": "matplotlib.pyplot", "as": "plt"},
{"name": "seaborn", "as": "seaborn"},
{"name": "matplotlib.pyplot.plot", "as": "plot"},
],
"functions" : [
"matplotlib.pyplot.plot",
"seaborn.__version__",
"matplotlib.pyplot.plot",
]

The parser is capable of resolving renames of functions or modules which may incidentally occur (e.g., see above where a student may have renamed matplotlib.pyplot to plt by using as while importing) and also ignores any EASEx proprietary code.

danger

The parser only resolves upto a syntactically correct code statement. All cells after an incorrect syntax would be automatically ignored. As such it becomes important that students are instructed not to leave any incorrect cells when writing programming code.

Answer Checking

The NLU is also responsible for answer checking, which has been discussed in detail previously here. Answer checking is not 100% accurate (just like any machine learning algorithm) and heavily depends on the quality and quantity of the answers and training data. This has only been provided as feature to allow scaffolds dependent on current answer in problem-solving sessions where a student can answer multiple times.

Although both speech generation and text to speech conversion are integrally related to the NLU, we still use them in the 3D renderer to considerably increase our rendering speed.