-
Notifications
You must be signed in to change notification settings - Fork 0
/
readme.txt
53 lines (38 loc) · 2.06 KB
/
readme.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
1)dataset.txt has the stored data or the training data of the model
2)testing.py will first load the model and then the complete implementation of real time words
The data model I have followed is
-> I will pair up 3 words of a list
-> create a tuple from the list
-> use the created tuple as the key for the dictionary
-> the value of the dictionary will again be a dictionary which has the next words as keys and its frequency as values
so for example the input is
"hello i am dharin hello i am riteek hello i am ankur hello i am vishwa hello i am dharin and we love to code"
the dictionary will be of the form
{"('dharin', 'and', 'we')": {"love": 1},
"('am', 'riteek', 'hello')": {"i": 1},
"('i', 'am', 'ankur')": {"hello": 1},
"('love', 'to', 'code')": {"*****": 1},
"('dharin', 'hello', 'i')": {"am": 1},
"('i', 'am', 'dharin')": {"and": 1, "hello": 1},
"('and', 'we', 'love')": {"to": 1},
.....
.....
.....
"('hello', 'i', 'am')": {"riteek": 1, "vishwa": 1, "dharin": 2, "ankur": 1},
This all will happen when we run the file 'load.py'
Now after creating a model we can run 'testing.py' which will first take 3 buffer inputs that is wont predict anything in these inputs as we have a 3rd order model. We cant predict from the first command.
so suppose you type the first three words as 1)hello 2)i 3)am
it will output a simple string saying 'prediction dharin'
you can obviously type anything then
take an example we typed
1)'vishwa'
It will increase the frequency in the
"('hello', 'i', 'am')": {"riteek": 1, "vishwa": 2, "dharin": 2, "ankur": 1},
2)'xyz'
It will add a new entry with frequency 1
"('hello', 'i', 'am')": {"riteek": 1, "vishwa": 1, "dharin": 2, "ankur": 1."xyz":1},
Basically the model changes dynamically according to the input
The word 'exit' will end the testing.py and ask us if we want to save the new model or let our old model remain.
this is the work progress yet.
Doubts and Mistakes:
2) "('love', 'to', 'code')": {"*****": 1}, i am marking the end of file using '*****' so if we ever type 'love to code' as input it will give prediction '*****'