Update README.md
Browse files
README.md
CHANGED
@@ -16,7 +16,7 @@ Model was trained with size 512 and 3 layers, dropout 0.5.
|
|
16 |
The procedure for installing the required software is described [by Karpathy](https://github.com/karpathy/char-rnn), torch is required, the code is written in lua. Be careful, versions of libraries written many years ago are used.
|
17 |
|
18 |
```bash
|
19 |
-
th sample.lua
|
20 |
```
|
21 |
|
22 |
## Train data
|
@@ -30,4 +30,103 @@ In an era of winning Transformers, ancient RNN models seem archaic. But I see th
|
|
30 |
|
31 |
This model was created just or fun of students at the end of the course.
|
32 |
|
|
|
33 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
The procedure for installing the required software is described [by Karpathy](https://github.com/karpathy/char-rnn), torch is required, the code is written in lua. Be careful, versions of libraries written many years ago are used.
|
17 |
|
18 |
```bash
|
19 |
+
th sample.lua lm_lstm_epoch27.89_0.7387.t7 -length 10000 -temperature 0.5 -primetext 'some text'
|
20 |
```
|
21 |
|
22 |
## Train data
|
|
|
30 |
|
31 |
This model was created just or fun of students at the end of the course.
|
32 |
|
33 |
+
## Samples
|
34 |
|
35 |
+
### temperature 0.5
|
36 |
+
|
37 |
+
```python
|
38 |
+
some text] and re.search('<meta content=\"(.*)\" name=\"author\"></meta>", oneline):
|
39 |
+
for line in a:
|
40 |
+
if re.search('<w><ana lex=\"(.+)\" gr=\".+"></ana>(.+?)</w>', line):
|
41 |
+
s = re.search(reg_adj, line)
|
42 |
+
if r:
|
43 |
+
k = re.search('<meta content="(.+?)" name="author">', txt))
|
44 |
+
sentences = re.sub('</w>', '', s)
|
45 |
+
with open('file.txt', 'a', encoding = 'utf-8') as f:
|
46 |
+
f.write(i+' '+count_words(f)
|
47 |
+
f.write('\n')
|
48 |
+
f.write('Выполняется файлов в папке в нет
|
49 |
+
можно сделеть слово слово в папка с цифрами в названии в папка с программой и папенается в тексте нет разной инит.')
|
50 |
+
print('Творительный падеж, единственное число')
|
51 |
+
elif word.endswith('ах') or word.endswith ('ям'):
|
52 |
+
print('Poss
|
53 |
+
```
|
54 |
+
|
55 |
+
### temperature 0.6
|
56 |
+
|
57 |
+
```python
|
58 |
+
|
59 |
+
def noun_midles(words):
|
60 |
+
print(result)
|
61 |
+
def main():
|
62 |
+
print('В тексте нет попыгамителись попытка слов в препинания в ланное не равно киличество файлов (' + str(arr))
|
63 |
+
def main():
|
64 |
+
maxi = max_pmi_any(s, 'answ')
|
65 |
+
print(count_form(textik, dictionary)
|
66 |
+
def main():
|
67 |
+
forms = open_file()
|
68 |
+
words = open_text(way_to_file)
|
69 |
+
words = []
|
70 |
+
for i in range(len(forms)):
|
71 |
+
if '.'
|
72 |
+
words += word.strip('.,!?//()":;/|\)\'»\n\t ')
|
73 |
+
reg_author = '<meta content="(.+?)" name="author"'
|
74 |
+
bigrams.append(f +'\t'+str(pos[forms[i])+1
|
75 |
+
else:
|
76 |
+
dic[file] = 1
|
77 |
+
else:
|
78 |
+
d[key] = 1
|
79 |
+
else:
|
80 |
+
dic[key] = 1
|
81 |
+
else:
|
82 |
+
dic[lemmes[i]] += 1
|
83 |
+
return d
|
84 |
+
def write_out_count_forms(text):
|
85 |
+
arr = re.findall('<w>(.+?)</w>', text)
|
86 |
+
return text
|
87 |
+
def find_max(string, 'words_anes)
|
88 |
+
|
89 |
+
```
|
90 |
+
|
91 |
+
### temperature 0.7
|
92 |
+
|
93 |
+
```python
|
94 |
+
|
95 |
+
import re
|
96 |
+
def main():
|
97 |
+
maxi = max(pmi)
|
98 |
+
number = int(input('Введите слово: ')
|
99 |
+
if os.path.isfile(f):
|
100 |
+
for key in d:
|
101 |
+
f.write(key + '\n')
|
102 |
+
f.close()
|
103 |
+
return
|
104 |
+
def main():
|
105 |
+
text = text_process('text.txt')
|
106 |
+
words = []
|
107 |
+
words = []
|
108 |
+
for word in words:
|
109 |
+
word = word.strip('.,;:?!'))
|
110 |
+
f.close()
|
111 |
+
return forms
|
112 |
+
def names_file(fname):
|
113 |
+
with open (fname, 'r', encoding = 'utf-8') as f:
|
114 |
+
text = f.read()
|
115 |
+
return text
|
116 |
+
def count_text(text):
|
117 |
+
text2 = re.sub(u'<.*?></w>', text)
|
118 |
+
return text
|
119 |
+
def count_text(word, text):
|
120 |
+
t = open_text(fname)
|
121 |
+
return file
|
122 |
+
def author('text.txt'):
|
123 |
+
for i in range(len(reg)):
|
124 |
+
forms[i] = words[i].strip('.,?!()*&^%$
|
125 |
+
file[i] = file[i].strip('.,?!()*&^%$
|
126 |
+
for k in range(len(list_)):
|
127 |
+
if len(strings)>1:
|
128 |
+
print('Олонаким препинания.html', 'a раздания')
|
129 |
+
word=re.sub('<.*?>', '', word, text)
|
130 |
+
|
131 |
+
|
132 |
+
```
|