Guest User

Untitled

a guest
Jan 24th, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 KB | None | 0 0
  1. id source-actor source-content source-targets source-type ts
  2. 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
  3. 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
  4.  
  5. print(self.messages_df)
  6. self.messages_df.to_csv("messages.csv", sep='t')
  7. i = 0
  8. for row in self.messages_df:
  9. if self.messages_df['source-content'][i]['type'] == 'message':
  10. if self.messages_df['source-content'][i]['subtype'] == 'chat':
  11. self.messages_df['source-content'] = self.messages_df['dic'].apply(lambda x: x.get('Feature3'))
  12.  
  13. file = 'chattextfile.txt'
  14. if self.channel == '':
  15. with open(file, 'w') as f:
  16. f.write(row['text'])
  17. else:
  18. if row['channel_name'] == self.channel:
  19. with open(file, 'w') as f:
  20. f.write(row['text'])
  21. else:
  22. continue
  23.  
  24. print(self.messages_df['source-content'][i]['subtype'] == 'chat')
  25. i = i + 1
  26. idx = idx + 1
Add Comment
Please, Sign In to add comment