Advertisement
Guest User

Untitled

a guest
Mar 25th, 2019
788
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.78 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 15,
  6. "metadata": {},
  7. "outputs": [],
  8. "source": [
  9. "sb_fname = 'tb_log/sb_3000/topics_epoch50.txt'\n",
  10. "sb_os_fname = 'tb_log/sb_os_1386/topics_epoch50.txt'\n",
  11. "cmt_fname = 'tb_log/cmt2000/topics_epoch100.txt'\n",
  12. "hashtag_fname = 'topics/test/topics_epoch100.txt'"
  13. ]
  14. },
  15. {
  16. "cell_type": "code",
  17. "execution_count": 2,
  18. "metadata": {},
  19. "outputs": [],
  20. "source": [
  21. "def open_text(fname):\n",
  22. " with open(fname, 'r') as f:\n",
  23. " return f.readlines()"
  24. ]
  25. },
  26. {
  27. "cell_type": "code",
  28. "execution_count": 16,
  29. "metadata": {},
  30. "outputs": [],
  31. "source": [
  32. "sb = open_text(sb_fname)\n",
  33. "sb_os = open_text(sb_os_fname)\n",
  34. "cmt = open_text(cmt_fname)\n",
  35. "hashtag = open_text(hashtag_fname)"
  36. ]
  37. },
  38. {
  39. "cell_type": "code",
  40. "execution_count": 9,
  41. "metadata": {},
  42. "outputs": [],
  43. "source": [
  44. "classes = [\n",
  45. " 'stmt', 'stmt-opinion', 'appreciation', 'agree', 'reject', 'dispreferred', 'offer',\n",
  46. " 'ack', 'opening', 'closing', 'thanking', 'sympathy', 'hedge', 'rh-q', 'non-understanding',\n",
  47. " 'apology', 'wh-q', 'yes/no-q', 'backchannel-q', 'tag-q',\n",
  48. "]"
  49. ]
  50. },
  51. {
  52. "cell_type": "markdown",
  53. "metadata": {},
  54. "source": [
  55. "## DA-Word distribution"
  56. ]
  57. },
  58. {
  59. "cell_type": "code",
  60. "execution_count": 35,
  61. "metadata": {},
  62. "outputs": [
  63. {
  64. "name": "stdout",
  65. "output_type": "stream",
  66. "text": [
  67. "<stmt>\n",
  68. "Default: gotten federal during started everywhere cold itself sitting comfortable changed younger miss finding hang new gone busy wo relatively general\n",
  69. "Oversampled: likes went moved had classical traveling ours stopped figured fourth told ended sat and our occasionally thought playing three stayed\n",
  70. "\n",
  71. "<stmt-opinion>\n",
  72. "Default: because some there be much over we seems would say will us could in guess more maybe if from need\n",
  73. "Oversampled: especially need nowadays gives paying relaxing seems quickly sooner complicated dangerous certain think committed boring overall unfortunate hire lot their\n",
  74. "\n",
  75. "<appreciation>\n",
  76. "Default: my interesting sounds wonderful great bad amazing gorgeous cute bet imagine fantastic surprised understand awful good funny cool be pretty\n",
  77. "Oversampled: darned hilarious holy understandable neat fantastic frightening odd great gracious darn fascinating unusual understand imagine bet sounds poor wild super\n",
  78. "\n",
  79. "<agree>\n",
  80. "Default: absolutely right exactly sure am will true does much definitely with is there too would certainly probably guess tend unpopular\n",
  81. "Oversampled: agree true voted definitely top sooner exactly burned fabulous probably awesome admit fourth tend think pleased stuck eventually lot ran\n",
  82. "\n",
  83. "<reject>\n",
  84. "Default: tell not eighty based large relatively gets occur passed miss rich spend less yet anywhere disagree federal high among change\n",
  85. "Oversampled: acquainted widespread comfy continues gory hilly wide communist refuted vegan jamming notice specifically searching mail fished divide diving adopt mobile\n",
  86. "\n",
  87. "<dispreferred>\n",
  88. "Default: depends itself react actually south handle part limited disagree occur everywhere based able less miss played turned rich come negotiated\n",
  89. "Oversampled: wealthy layed statistical till entertained sail spoon unsmashed peripheral favorable formed fixed affect circular freeze exclude administrating de claiming thaw\n",
  90. "\n",
  91. "<offer>\n",
  92. "Default: rich everywhere cost teach stay realize relatively miss since ago lost occur finding among made least twelve busy stuck create\n",
  93. "Oversampled: switch let press sometime reword punch repealed clears head damn contact drink pressurized softly explain encourage look push ask cleaner\n",
  94. "\n",
  95. "<ack>\n",
  96. "Default: four hear keeps fast grow each upon rich central miss relatively occur camping based thirty hang eighteen see both among\n",
  97. "Oversampled: watchi damp hurtle senior african see coarse yellow rub brand mexican dark dying visit secret sharing breaking chop type mumblex\n",
  98. "\n",
  99. "<opening>\n",
  100. "Default: itself based rich teach supposed everywhere keeps lost comfortable sitting second relatively handle putting buying among today covered younger unfortunate\n",
  101. "Oversampled: fine visiting chat doing today from my welcome in this live certainly calling are and good said is how mumblex\n",
  102. "\n",
  103. "<closing>\n",
  104. "Default: talk talking enjoyed later talked anyway bless met been motivated nice over with too throughout finding cooking again from enjoy\n",
  105. "Oversampled: talking enjoyed ge pair thrown practically meet repairing paged covered distracted covers slowly exhausted talked nice cross pleasant talks wrap\n",
  106. "\n",
  107. "<thanking>\n",
  108. "Default: involved tell rich based stay cost keeps change lot past relatively miss hang second sitting unfortunate expensive fortunate happen occur\n",
  109. "Oversampled: noticing thank punching participating for you helpful much very an being appreciate calling so the on all and watchi pair\n",
  110. "\n",
  111. "<sympathy>\n",
  112. "Default: everywhere wants went keeps finding perhaps private hang needs along sitting miss relatively comfortable younger recycle among catch apparently stop\n",
  113. "Oversampled: must hard sad real bad better terrible her blame too get been hope that so have about sorry what watchi\n",
  114. "\n",
  115. "<hedge>\n",
  116. "Default: do call n't helpful cruel obviously profound don sort relatively sure miss maybe misuse bottomed tries knows bear stressful though\n",
  117. "Oversampled: invading know shou hesitate don wonde do kn n't but face died publicized kno gather cruel unusual differently though say\n",
  118. "\n",
  119. "<rh-q>\n",
  120. "Default: voting why over capital accused dead us miss doing knows wind increased who handle cost convict writes getting high lost\n",
  121. "Oversampled: awol bitty net iffy voting croak checked who cares sour tests evil invest fascinated warlike pattern compromise impartial rectify insane\n",
  122. "\n",
  123. "<non-understanding>\n",
  124. "Default: ago during busy miss private finding hang twelve occur beg comfortable recycle realize general among unless unfortunate looked wind capital\n",
  125. "Oversampled: lax rolly polly howl deduct steamed ending lock unsweetened regards criminal ar beyond vote saying what pick say rid eighty\n",
  126. "\n",
  127. "<apology>\n",
  128. "Default: based after everywhere cost rich cold hang relatively suppose miss since stuck perhaps teach change ... younger lost concerned recycle\n",
  129. "Oversampled: dropped apologize clear primarily interrupted roped strongly waiting coughing cut upset until got am on keep hate home these anyway\n",
  130. "\n",
  131. "<wh-q>\n",
  132. "Default: where from old are your did feel lately long about spend what far you in favorite first why wh do\n",
  133. "Oversampled: sending whereabouts what spell wh old overseas which feel your yourself mini providing main favorite long handling supporting yours about\n",
  134. "\n",
  135. "<yes/no-q>\n",
  136. "Default: did there are any does you in or she is go over from with work first your have exercise had\n",
  137. "Oversampled: ever native subscribe have invaded standard y'all special near ready certain exercise served tested still active participate specific train watch\n",
  138. "\n",
  139. "<backchannel-q>\n",
  140. "Default: itself everywhere occur spend worth keeps capital such hang rough rich busy lost made large unfortunate comfortable private recycle perhaps\n",
  141. "Oversampled: remain blue communicate recent missing japanese kidding did ski are is serious you rough deserve rid while amazing scary does\n",
  142. "\n",
  143. "<tag-q>\n",
  144. "Default: federal during based cut everywhere cost wants started comfortable private cold working sitting hang miss relatively younger finding sound capital\n",
  145. "Oversampled: does he down correct it by did they she n't is you would are do mean right awol net iffy\n",
  146. "\n"
  147. ]
  148. }
  149. ],
  150. "source": [
  151. "for cls, w1, w2 in zip(classes, sb, sb_os):\n",
  152. " print(f'<{cls}>')\n",
  153. " print('Default:', w1, end='')\n",
  154. " print('Oversampled:', w2)"
  155. ]
  156. },
  157. {
  158. "cell_type": "markdown",
  159. "metadata": {},
  160. "source": [
  161. "## Topic-Word distribution"
  162. ]
  163. },
  164. {
  165. "cell_type": "code",
  166. "execution_count": 18,
  167. "metadata": {},
  168. "outputs": [],
  169. "source": [
  170. "import random\n",
  171. "\n",
  172. "def random_topic():\n",
  173. " idx = random.randint(0, 100)\n",
  174. " print('Hashtag:', hashtag[idx], end='')\n",
  175. " print('Comment:', cmt[idx])"
  176. ]
  177. },
  178. {
  179. "cell_type": "code",
  180. "execution_count": 36,
  181. "metadata": {},
  182. "outputs": [
  183. {
  184. "name": "stdout",
  185. "output_type": "stream",
  186. "text": [
  187. "Hashtag: eye_spy_birds bird kings_birds feather_perfection birds_adored bestbirdshots macro birdphotography best_birds_of_ig birdfreaks\n",
  188. "Comment: macro owl bird dank photographed capture bee wel finland muito\n",
  189. "\n",
  190. "Hashtag: sexy beard modeling boy instagay youtuber actress models blackgirlmagic memories\n",
  191. "Comment: smile hermosa beard baby lady photoshoot girl hair linda party\n",
  192. "\n",
  193. "Hashtag: manhattan citylife travel_drops thisislondon newyorker cityscape kings_villages theprettycities living_destinations hello_worldpics\n",
  194. "Comment: edinburgh london york vienna europe street mark scotland boston italy\n",
  195. "\n",
  196. "Hashtag: oilpainting streetart modernart realism abstractpainting watercolour originalart painter artlife watercolorpainting\n",
  197. "Comment: watercolour painting canvas artwork cm progress oil print etsy dm\n",
  198. "\n",
  199. "Hashtag: mondaymotivation girlpower sports body sport girlswholift humpday gymmotivation healthylifestyle bikini\n",
  200. "Comment: fitness body week gym workout yoga football lol kick goal\n",
  201. "\n",
  202. "Hashtag: sexy beard modeling boy instagay youtuber actress models blackgirlmagic memories\n",
  203. "Comment: smile hermosa beard baby lady photoshoot girl hair linda party\n",
  204. "\n",
  205. "Hashtag: lmao nichememes selfcarethreads humor bangtanboys jungkook sad taehyung the100 comedy\n",
  206. "Comment: blackpink dt jennie sc bias ib rm ac deleted ily\n",
  207. "\n",
  208. "Hashtag: travelmore bali traveldiary travelbug thailand surf traveldiaries exploring beautifulplace globetrotter\n",
  209. "Comment: beaches thailand destinations travels adventures dubai philippines wow vietnam desert\n",
  210. "\n",
  211. "Hashtag: mondaymotivation girlpower sports body sport girlswholift humpday gymmotivation healthylifestyle bikini\n",
  212. "Comment: fitness body week gym workout yoga football lol kick goal\n",
  213. "\n",
  214. "Hashtag: wanderer dametraveler wearetravelgirls travelmore doyoutravel bali travelgirl hotel visiting goexplore\n",
  215. "Comment: hotels bucket trip greece resort exploring vacation hotel places mykonos\n",
  216. "\n",
  217. "Hashtag: likeforlike f4f follow4follow followforfollow shoutout chandigarh pic tamil lover modeling\n",
  218. "Comment: pic page kya admin ji pics hai ur ka bhi\n",
  219. "\n",
  220. "Hashtag: tiktok cardib kiss lfl funnyvideos lmao iloveyou kyliejenner humor comedy\n",
  221. "Comment: tiktok omgpage fuck underrated edit kiss reaction netflix sm hahaha\n",
  222. "\n",
  223. "Hashtag: technology tech america engineering videogames xbox fortnitememes pc pubg apple\n",
  224. "Comment: iphone fortnite squad wtf dm law mates twitter issues inquiries\n",
  225. "\n",
  226. "Hashtag: southafrica africanamazing elephant animalsofinstagram conservation bigcats wildlife_seekers animalphotography leopard wildlifeaddicts\n",
  227. "Comment: lion caption leopard pictures videos promotions accessories mum monkey mom\n",
  228. "\n",
  229. "Hashtag: portraits photos moment pics followforfollow pictures follow4follow portraiture toptags capture\n",
  230. "Comment: globe model frame pc photographer portraits editing india mua superb\n",
  231. "\n",
  232. "Hashtag: creativeoptic urbanandstreet enter_imagination streets_vision creative_ace milliondollarvisuals citykillerz weekly_feature urbanromantix all2epic\n",
  233. "Comment: affiliated lightroom presets shots chanel op chance tones ps ace\n",
  234. "\n",
  235. "Hashtag: america custom aviation fly bikelife flying avgeek mercedes airplane bmw\n",
  236. "Comment: custom machine crew coolest model ass lol kit repost badass\n",
  237. "\n",
  238. "Hashtag: urbanromantix creativeoptic streets_vision visualmobs urbanandstreet milliondollarvisuals thecreatorclass citykillerz all2epic enter_imagination\n",
  239. "Comment: bnw thanks team composition merci shadows presents hubs night bravo\n",
  240. "\n",
  241. "Hashtag: bhghome interiorstyle homestyle modernfarmhouse instahome interior4all kitchen bedroom livingroom dreamhome\n",
  242. "Comment: room tile chairs chair kitchen table space fireplace wall yay\n",
  243. "\n",
  244. "Hashtag: skyporn special_shots ig_shotz colors_of_day longexposure_shots longexpoelite sunsetlovers sunsets landscape_lovers landscapelovers\n",
  245. "Comment: serenity stolen exposure sunset raf finland night nature location reflect\n",
  246. "\n"
  247. ]
  248. }
  249. ],
  250. "source": [
  251. "for _ in range(0, 20):\n",
  252. " random_topic()"
  253. ]
  254. }
  255. ],
  256. "metadata": {
  257. "kernelspec": {
  258. "display_name": "Python 3",
  259. "language": "python",
  260. "name": "python3"
  261. },
  262. "language_info": {
  263. "codemirror_mode": {
  264. "name": "ipython",
  265. "version": 3
  266. },
  267. "file_extension": ".py",
  268. "mimetype": "text/x-python",
  269. "name": "python",
  270. "nbconvert_exporter": "python",
  271. "pygments_lexer": "ipython3",
  272. "version": "3.6.8"
  273. }
  274. },
  275. "nbformat": 4,
  276. "nbformat_minor": 2
  277. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement