[PYTHON] Learning record No. 29 (33rd day)

Learning record (33rd day)

Start studying: Saturday, December 7th

Teaching materials, etc .: ・ Miyuki Oshige "Details! Python3 Introductory Note ”(Sotec, 2017): 12/7 (Sat) -12/19 (Thu) read ・ Progate Python course (5 courses in total): 12/19 (Thursday) -12/21 (Saturday) end ・ Andreas C. Müller, Sarah Guido "(Japanese title) Machine learning starting with Python" (O'Reilly Japan, 2017): 12/21 (Sat) -December 23 (Sat) ・ Kaggle: Real or Not? NLP with Disaster Tweets: Posted on Saturday, December 28th to Friday, January 3rd Adjustment ・ Wes Mckinney "(Japanese title) Introduction to data analysis by Python" (O'Reilly Japan, 2018): 1/4 (Wednesday) to 1/13 (Monday) read ・ Yasuki Saito "Deep Learning from Zero" (O'Reilly Japan, 2016): 1/15 (Wed) -1/20 (Mon) ・ ** François Chollet “Deep Learning with Python and Keras” (Queep, 2018): 1/21 (Tue) ~ **

"Deep learning with Python and Keras"

p.261 Chapter 6 Deep Learning for Texts and Sequences Finished reading halfway.

Learned word embedding (2nd day)

The tokenization that was struggling yesterday has been completed.

Data preprocessing (natural language processing)


#type : pandas.core.series.Series

#Convert to lowercase
X_l = X.str.lower()

#Replace unnecessary characters with half-width spaces.
X_r = X_l.replace(',', ' ').replace('.', ' ').replace('#', ' ').replace('#', ' ').replace('!', ' ').replace('!', ' ').replace(' ', ' ')

#Divide each word using a half-width space as a separator
X_s = X_r.str.split(' ')

#Defined together
def make_vector(df):
    X_l = df.str.lower()
    X_r = X_r = X_l.replace(',', ' ').replace('.', ' ').replace('#', ' ').replace('#', ' ').replace('!', ' ').replace('!', ' ').replace(' ', ' ')
    X_s = X_r.str.split(' ')
    return X_s

Now that we've tokenized the text retrieved from the dataset, all we have to do now is train the defined model. (Under implementation)

By the way, at first I tried to take out one by one and turn it with a for statement as follows, but it doesn't work. a.png I wondered if it would be okay to preprocess the Series as it is without having to take it out, so I looked it up and found that it was still possible. Write while referring to the pandas official (API reference, Series) for preprocessing Succeeded.

Recommended Posts

Learning record No. 19 (23rd day)
Learning record No. 29 (33rd day)
Learning record No. 10 (14th day)
Learning record No. 17 (21st day)
Learning record No. 18 (22nd day)
Learning record No. 24 (28th day)
Learning record No. 28 (32nd day)
Learning record No. 23 (27th day)
Learning record No. 25 (29th day)
Learning record No. 26 (30th day)
Learning record No. 20 (24th day)
Learning record No. 27 (31st day)
Learning record No. 14 (18th day) Kaggle4
Learning record No. 15 (19th day) Kaggle5
Learning record 4 (8th day)
Learning record 9 (13th day)
Learning record 3 (7th day)
Learning record 5 (9th day)
Learning record 6 (10th day)
Programming learning record day 2
Learning record 1 (4th day)
Learning record 7 (11th day)
Learning record 2 (6th day)
Learning record 16 (20th day)
Learning record 22 (26th day)
Learning record 13 (17th day) Kaggle3
Learning record 12 (16th day) Kaggle2
Learning record
Learning record # 3
Learning record # 1
Learning record 11 (15th day) Kaggle participation
Learning record (3rd day) #CSS selector description method #BeautifulSoup scraping
Learning record (2nd day) Scraping by #BeautifulSoup
Learning record so far
Go language learning record
Linux learning record ① Plan
Effective Python Learning Memorandum Day 15 [15/100]
<Course> Deep Learning: Day2 CNN
Effective Python Learning Memorandum Day 6 [6/100]
Effective Python Learning Memorandum Day 9 [9/100]
Effective Python Learning Memorandum Day 8 [8/100]
<Course> Deep Learning: Day1 NN
Effective Python Learning Memorandum Day 14 [14/100]
Effective Python Learning Memorandum Day 1 [1/100]
Subjects> Deep Learning: Day3 RNN
63rd day I installed tensorflow.
Rabbit Challenge Deep Learning 2Day
Effective Python Learning Memorandum Day 3 [3/100]
Effective Python Learning Memorandum Day 4 [4/100]
Effective Python Learning Memorandum Day 7 [7/100]
Effective Python Learning Memorandum Day 2 [2/100]
Thoroughly study Deep Learning [DW Day 0]
Learning record (4th day) #How to get the absolute path from the relative path