Developed for an Artificial Intelligence course - AIAD - this application allows to define and obtain hotel information, using natural language, in Portuguese, as if it were an information desk.
Definite Clause Grammars, HTML, JavaScript, Natural Language, Prolog, Knowledge Representation.
Example of a grammar error: 'Espanha' is not in the defined lexicon.
Example of grammatical error: The word 'Porto' requires the preposition 'no' or 'do'.
The information is inconsistent with the knowledge base.
The information is consistent with the knowledge base.
Example of a question using context, introduced by the 'e' particle.
Example of a declaration of new information.
Example of an information update.
In both cases, it should be noted the need to end the sentence with ';', otherwise the statement will be interpreted as a statement.
For the implementation, it was considered a division into five modules:
• a module with the knowledge representation, containing the system's information;
• a module with the lexicon recognized;
• a module responsible for sentence analysis;
• a module responsible for generating responses;
• a user interface module.
In order to have the system running on your local machine for development and testing purposes see the notes below.
• SICStus Prolog - to run the program in Prolog;
• Mongoose - web server to connect; save the .exe file in the project folder.
The program can be used exclusively from the SICStus Prolog interface or from a web interface.
- Open SICStus console
- Go to File->Consult
- Navigate to the folder src/ and select the file sobre_hoteis.pl
a) Enter the command:
processar(+Phrase, -Response).
where Phrase represents a list with the words of the phrase.
Warning: For operational reasons, all the words in the lexicon are in lowercase letters without stress. In particular, the verbal form 'é' is defined as 'e_', so as to distinguish it from the conjunction 'e'. If in doubt, consult the file "lexico.pl".
a) Enter, without arguments, the command 'servidor.';
b) Execute mongoose and navigate to the src folder;
c) Open the index.html file;