Small modifications

This commit is contained in:
lkrsnik 2018-04-20 21:15:40 +02:00
parent 9f6e5b2752
commit 160b8237e7
2 changed files with 3 additions and 2 deletions

View File

@ -1500,7 +1500,8 @@ class Data:
new_predictions = np.zeros(predictions.shape, dtype='float32') new_predictions = np.zeros(predictions.shape, dtype='float32')
for i in range(len(predictions)): for i in range(len(predictions)):
word_len = self.count_syllables(words[i][0], vowels) word_len = self.count_syllables(words[i][0], vowels)
if word_len > 10:
word_len = 10
for k in range(word_len): for k in range(word_len):
new_predictions[i][k] += predictions[i][word_len - 1 - k] new_predictions[i][k] += predictions[i][word_len - 1 - k]

View File

@ -47,7 +47,7 @@ print('Commencing accentuator!')
rate = 100000 rate = 100000
start_timer = time.time() start_timer = time.time()
with open("data/new_sloleks/new_sloleks.tab", "a") as myfile: with open("data/new_sloleks/new_sloleks.tab", "a") as myfile:
for index in range(0, len(new_content), rate): for index in range(300000, len(new_content), rate):
if index+rate >= len(new_content): if index+rate >= len(new_content):
words = [[el[0], '', el[2], el[0]] for el in new_content][index:len(new_content)] words = [[el[0], '', el[2], el[0]] for el in new_content][index:len(new_content)]
else: else: