Guest User

Untitled

a guest
Nov 16th, 2018
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. 1 i
  2. 2 want
  3. 3 to
  4. 4 go
  5. 5 home
  6. 6 .
  7.  
  8. 7 i
  9. 8 love
  10. 9 cars
  11. 10 .
  12.  
  13. testfile=open("/Users/desktop/testset.txt").read().split('n')
  14.  
  15. for line in testfile:
  16. if not line.strip():
  17. continue
  18. index,word= line.split()
  19. if index == "1":
  20. testlines.append(sent)
  21. sent=['<s>', word]
  22. else:
  23. if word == '.':
  24. sent.append('</s>')
  25. else:
  26. sent.append(word)
Add Comment
Please, Sign In to add comment