This is a small demo for simple semantic-net building algorithm.
In short:
- Delete prepositions, pronouns, punctuation.
- Build the vocabulary:
{ keyword: string, type: object | action | notion, occurenceCount: int, lins: Link[] }
- Filter vocabulary with entries where
occurenceCount
is bigger thantwo
. - Classify each vocabulary entry:
As an object we consider all keywords which describe physical issues, things and phenomena. An action is infinitive form. All keywords that we have not classified as objects or actions are the notions.
- Build a semantic net, where the vertexes are the keywords from the vocabulary.
Link between two nodes has three classes: «isa», «part of» и «kind of». The link «isa» symbolizes a rule «IF-THEN». It takes place between an object and an action or between two actions or two objects. The link «part of» is possible, when one term is a part of another. It occurs between two objects or actions only. The arc «kind of» describes the link between keywords “object” and “notion” only.
- Calculate the amount of link
isa
.
The app is built using Node.js, Express.js, Vis.js for graph rendering, Tacit as default CSS.
- Clone the repository.
- Download dependencies:
npm install
. - Run the app:
npm run start
. - Access the app in a browser at
http://localhost
.
- Input text to build a semantic net from. Text should be big enough and have recurring words, because the net will be builded from words that have at least two occurrences.
- Toggle options:
- Alternative neighbour count defines that linked words are not directly next to each other, but in a range of few words. This can help with some texts.
- User 'partof' link enables scanning for 'partof' link. It occurs between object and action.
- Press 'Build a net'