Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- id source-actor source-content source-targets source-type ts
- 9 9 U04JLN95U {'type': 'message', 'subtype': 'chat', 'channel_id': 'C23U8N6QN', 'channel_name': 'contender', 'text': 'Y: Solved character encoding issue. Tried to extract text content of html tumblr text using Hersheys html extractor code. But most of the docs were not extracted successfully.nT: Will try to find ways of doing the html to text conversion successfully.', 'user': 'U04JLN95U'} ['C23U8N6QN'] slack 2016-10-12 05:17:47.000009060
- 10 10 U0B62PE2Y {'type': 'message', 'subtype': 'chat', 'channel_id': 'C23U8N6QN', 'channel_name': 'contender', 'text': 'Y:Was able to use a faster version of gensim while processing one sentence at a timenT: Will try to start the training using some sample files', 'user': 'U0B62PE2Y'} ['C23U8N6QN'] slack 2016-11-26 11:16:11.000005960
- print(self.messages_df)
- self.messages_df.to_csv("messages.csv", sep='t')
- i = 0
- for row in self.messages_df:
- if self.messages_df['source-content'][i]['type'] == 'message':
- if self.messages_df['source-content'][i]['subtype'] == 'chat':
- self.messages_df['source-content'] = self.messages_df['dic'].apply(lambda x: x.get('Feature3'))
- file = 'chattextfile.txt'
- if self.channel == '':
- with open(file, 'w') as f:
- f.write(row['text'])
- else:
- if row['channel_name'] == self.channel:
- with open(file, 'w') as f:
- f.write(row['text'])
- else:
- continue
- print(self.messages_df['source-content'][i]['subtype'] == 'chat')
- i = i + 1
- idx = idx + 1
Add Comment
Please, Sign In to add comment