Guest User

Untitled

a guest
Feb 19th, 2018
157
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 27.30 KB | None | 0 0
  1. {
  2. "cells": [
  3. {
  4. "cell_type": "code",
  5. "execution_count": 1,
  6. "metadata": {
  7. "collapsed": false
  8. },
  9. "outputs": [
  10. {
  11. "name": "stderr",
  12. "output_type": "stream",
  13. "text": [
  14. "Using TensorFlow backend.\n"
  15. ]
  16. }
  17. ],
  18. "source": [
  19. "from keras.datasets import reuters\n",
  20. "import pandas as pd\n"
  21. ]
  22. },
  23. {
  24. "cell_type": "code",
  25. "execution_count": 2,
  26. "metadata": {
  27. "collapsed": false
  28. },
  29. "outputs": [
  30. {
  31. "name": "stdout",
  32. "output_type": "stream",
  33. "text": [
  34. "Loading data...\n",
  35. "8982 train sequences\n",
  36. "2246 test sequences\n",
  37. "x_train shape: (8982,)\n",
  38. "y_train shape: (8982,)\n",
  39. "x_test shape: (2246,)\n",
  40. "y_test shape: (2246,)\n",
  41. "x_train[0]: [1, 2, 2, 8, 43, 10, 447, 5, 25, 207, 270, 5, 3095, 111, 16, 369, 186, 90, 67, 7, 89, 5, 19, 102, 6, 19, 124, 15, 90, 67, 84, 22, 482, 26, 7, 48, 4, 49, 8, 864, 39, 209, 154, 6, 151, 6, 83, 11, 15, 22, 155, 11, 15, 7, 48, 9, 4579, 1005, 504, 6, 258, 6, 272, 11, 15, 22, 134, 44, 11, 15, 16, 8, 197, 1245, 90, 67, 52, 29, 209, 30, 32, 132, 6, 109, 15, 17, 12]\n",
  42. "y_train[0:8]: [3 4 3 4 4 4 4 3]\n",
  43. "y_train.min: 0\n",
  44. "y_train.max: 45\n"
  45. ]
  46. }
  47. ],
  48. "source": [
  49. "NUM_WORDS = 20000 # only use top 20000 words\n",
  50. "#NUM_WORDS = 5000 # only use top 5000 words\n",
  51. "INDEX_FROM=3 # word index offset\n",
  52. "\n",
  53. "print('Loading data...')\n",
  54. "(x_train, y_train), (x_test, y_test) = reuters.load_data(num_words=NUM_WORDS, index_from=INDEX_FROM)\n",
  55. "print(len(x_train), 'train sequences')\n",
  56. "print(len(x_test), 'test sequences')\n",
  57. "print('x_train shape:', x_train.shape)\n",
  58. "print('y_train shape:', y_train.shape)\n",
  59. "print('x_test shape:', x_test.shape)\n",
  60. "print('y_test shape:', y_test.shape)\n",
  61. "\n",
  62. "print('x_train[0]:', x_train[0])\n",
  63. "print('y_train[0:8]:', y_train[0:8])\n",
  64. "\n",
  65. "print('y_train.min:', y_train.min())\n",
  66. "print('y_train.max:', y_train.max())\n"
  67. ]
  68. },
  69. {
  70. "cell_type": "code",
  71. "execution_count": 3,
  72. "metadata": {
  73. "collapsed": false
  74. },
  75. "outputs": [],
  76. "source": [
  77. "# Make Word to ID dictionary\n",
  78. "word_to_id = reuters.get_word_index()\n",
  79. "word_to_id = {k:(v+INDEX_FROM) for k,v in word_to_id.items()}\n",
  80. "word_to_id[\"[PAD]\"] = 0\n",
  81. "word_to_id[\"[πŸƒ]\"] = 1 # START\n",
  82. "word_to_id[\"[❓]\"] = 2 # UNKNOWN\n",
  83. "\n",
  84. "# Make ID to Word dictionary\n",
  85. "id_to_word = {value:key for key,value in word_to_id.items()}"
  86. ]
  87. },
  88. {
  89. "cell_type": "code",
  90. "execution_count": 4,
  91. "metadata": {
  92. "collapsed": false
  93. },
  94. "outputs": [
  95. {
  96. "data": {
  97. "text/html": [
  98. "<div>\n",
  99. "<table border=\"1\" class=\"dataframe\">\n",
  100. " <thead>\n",
  101. " <tr style=\"text-align: right;\">\n",
  102. " <th></th>\n",
  103. " <th>index</th>\n",
  104. " <th>x_train original_text</th>\n",
  105. " <th>y_train</th>\n",
  106. " </tr>\n",
  107. " </thead>\n",
  108. " <tbody>\n",
  109. " <tr>\n",
  110. " <th>0</th>\n",
  111. " <td>0</td>\n",
  112. " <td>[πŸƒ] [❓] [❓] said as a result of its december a...</td>\n",
  113. " <td>3</td>\n",
  114. " </tr>\n",
  115. " <tr>\n",
  116. " <th>1</th>\n",
  117. " <td>1</td>\n",
  118. " <td>[πŸƒ] generale de banque sa lt genb br and lt he...</td>\n",
  119. " <td>4</td>\n",
  120. " </tr>\n",
  121. " <tr>\n",
  122. " <th>2</th>\n",
  123. " <td>2</td>\n",
  124. " <td>[πŸƒ] shr 3 28 dlrs vs 22 cts shr diluted 2 99 d...</td>\n",
  125. " <td>3</td>\n",
  126. " </tr>\n",
  127. " <tr>\n",
  128. " <th>3</th>\n",
  129. " <td>3</td>\n",
  130. " <td>[πŸƒ] the farmers home administration the u s ag...</td>\n",
  131. " <td>4</td>\n",
  132. " </tr>\n",
  133. " <tr>\n",
  134. " <th>4</th>\n",
  135. " <td>4</td>\n",
  136. " <td>[πŸƒ] seton co said its board has received a pro...</td>\n",
  137. " <td>4</td>\n",
  138. " </tr>\n",
  139. " <tr>\n",
  140. " <th>5</th>\n",
  141. " <td>5</td>\n",
  142. " <td>[πŸƒ] the u s agriculture department estimated c...</td>\n",
  143. " <td>4</td>\n",
  144. " </tr>\n",
  145. " <tr>\n",
  146. " <th>6</th>\n",
  147. " <td>6</td>\n",
  148. " <td>[πŸƒ] lt qintex america ltd said it is again ext...</td>\n",
  149. " <td>4</td>\n",
  150. " </tr>\n",
  151. " <tr>\n",
  152. " <th>7</th>\n",
  153. " <td>7</td>\n",
  154. " <td>[πŸƒ] shr 49 cts vs 39 cts net 886 937 vs 892 32...</td>\n",
  155. " <td>3</td>\n",
  156. " </tr>\n",
  157. " <tr>\n",
  158. " <th>8</th>\n",
  159. " <td>8</td>\n",
  160. " <td>[πŸƒ] oper shr 23 cts vs 77 cts oper net 5 255 1...</td>\n",
  161. " <td>3</td>\n",
  162. " </tr>\n",
  163. " <tr>\n",
  164. " <th>9</th>\n",
  165. " <td>9</td>\n",
  166. " <td>[πŸƒ] lt aramco corp has accepted japanese nomin...</td>\n",
  167. " <td>16</td>\n",
  168. " </tr>\n",
  169. " <tr>\n",
  170. " <th>10</th>\n",
  171. " <td>10</td>\n",
  172. " <td>[πŸƒ] period ended december 31 shr profit 11 cts...</td>\n",
  173. " <td>3</td>\n",
  174. " </tr>\n",
  175. " <tr>\n",
  176. " <th>11</th>\n",
  177. " <td>11</td>\n",
  178. " <td>[πŸƒ] lt international thomson organisation ltd ...</td>\n",
  179. " <td>3</td>\n",
  180. " </tr>\n",
  181. " <tr>\n",
  182. " <th>12</th>\n",
  183. " <td>12</td>\n",
  184. " <td>[πŸƒ] northview corp said it reached an agreemen...</td>\n",
  185. " <td>4</td>\n",
  186. " </tr>\n",
  187. " <tr>\n",
  188. " <th>13</th>\n",
  189. " <td>13</td>\n",
  190. " <td>[πŸƒ] federal reserve board governor robert hell...</td>\n",
  191. " <td>4</td>\n",
  192. " </tr>\n",
  193. " <tr>\n",
  194. " <th>14</th>\n",
  195. " <td>14</td>\n",
  196. " <td>[πŸƒ] the dollar is expected to decline further ...</td>\n",
  197. " <td>19</td>\n",
  198. " </tr>\n",
  199. " <tr>\n",
  200. " <th>15</th>\n",
  201. " <td>15</td>\n",
  202. " <td>[πŸƒ] commercial and industrial loans on the boo...</td>\n",
  203. " <td>8</td>\n",
  204. " </tr>\n",
  205. " <tr>\n",
  206. " <th>16</th>\n",
  207. " <td>16</td>\n",
  208. " <td>[πŸƒ] standard oil co said a contract has been a...</td>\n",
  209. " <td>16</td>\n",
  210. " </tr>\n",
  211. " <tr>\n",
  212. " <th>17</th>\n",
  213. " <td>17</td>\n",
  214. " <td>[πŸƒ] qtly div 72 cts vs 70 cts prior payable ju...</td>\n",
  215. " <td>3</td>\n",
  216. " </tr>\n",
  217. " <tr>\n",
  218. " <th>18</th>\n",
  219. " <td>18</td>\n",
  220. " <td>[πŸƒ] shr 1 24 dlrs vs 19 cts shr diluted 1 11 d...</td>\n",
  221. " <td>3</td>\n",
  222. " </tr>\n",
  223. " <tr>\n",
  224. " <th>19</th>\n",
  225. " <td>19</td>\n",
  226. " <td>[πŸƒ] austrian gross domestic product growth for...</td>\n",
  227. " <td>21</td>\n",
  228. " </tr>\n",
  229. " </tbody>\n",
  230. "</table>\n",
  231. "</div>"
  232. ],
  233. "text/plain": [
  234. " index x_train original_text y_train\n",
  235. "0 0 [πŸƒ] [❓] [❓] said as a result of its december a... 3\n",
  236. "1 1 [πŸƒ] generale de banque sa lt genb br and lt he... 4\n",
  237. "2 2 [πŸƒ] shr 3 28 dlrs vs 22 cts shr diluted 2 99 d... 3\n",
  238. "3 3 [πŸƒ] the farmers home administration the u s ag... 4\n",
  239. "4 4 [πŸƒ] seton co said its board has received a pro... 4\n",
  240. "5 5 [πŸƒ] the u s agriculture department estimated c... 4\n",
  241. "6 6 [πŸƒ] lt qintex america ltd said it is again ext... 4\n",
  242. "7 7 [πŸƒ] shr 49 cts vs 39 cts net 886 937 vs 892 32... 3\n",
  243. "8 8 [πŸƒ] oper shr 23 cts vs 77 cts oper net 5 255 1... 3\n",
  244. "9 9 [πŸƒ] lt aramco corp has accepted japanese nomin... 16\n",
  245. "10 10 [πŸƒ] period ended december 31 shr profit 11 cts... 3\n",
  246. "11 11 [πŸƒ] lt international thomson organisation ltd ... 3\n",
  247. "12 12 [πŸƒ] northview corp said it reached an agreemen... 4\n",
  248. "13 13 [πŸƒ] federal reserve board governor robert hell... 4\n",
  249. "14 14 [πŸƒ] the dollar is expected to decline further ... 19\n",
  250. "15 15 [πŸƒ] commercial and industrial loans on the boo... 8\n",
  251. "16 16 [πŸƒ] standard oil co said a contract has been a... 16\n",
  252. "17 17 [πŸƒ] qtly div 72 cts vs 70 cts prior payable ju... 3\n",
  253. "18 18 [πŸƒ] shr 1 24 dlrs vs 19 cts shr diluted 1 11 d... 3\n",
  254. "19 19 [πŸƒ] austrian gross domestic product growth for... 21"
  255. ]
  256. },
  257. "execution_count": 4,
  258. "metadata": {},
  259. "output_type": "execute_result"
  260. }
  261. ],
  262. "source": [
  263. "def restore_original_text(index_no):\n",
  264. " return (' '.join(id_to_word[id] for id in x_train[index_no] ))\n",
  265. "\n",
  266. "# Print Original Texts on pandas ( index 0 - 19)\n",
  267. "\n",
  268. "index_list = range(20)\n",
  269. "original_text_list = []\n",
  270. "y_train_list = []\n",
  271. "\n",
  272. "for i in index_list:\n",
  273. " original_text_list.append(restore_original_text(i))\n",
  274. " y_train_list.append(y_train[i])\n",
  275. " \n",
  276. "df = pd.DataFrame({'index': index_list, 'x_train original_text': original_text_list,'y_train': y_train_list}) \n",
  277. "\n",
  278. "df"
  279. ]
  280. },
  281. {
  282. "cell_type": "code",
  283. "execution_count": 5,
  284. "metadata": {
  285. "collapsed": false
  286. },
  287. "outputs": [
  288. {
  289. "name": "stdout",
  290. "output_type": "stream",
  291. "text": [
  292. "<< index >> : 0\n",
  293. "[πŸƒ] [❓] [❓] said as a result of its december acquisition of space co it expects earnings per share in 1987 of 1 15 to 1 30 dlrs per share up from 70 cts in 1986 the company said pretax net should rise to nine to 10 mln dlrs from six mln dlrs in 1986 and rental operation revenues to 19 to 22 mln dlrs from 12 5 mln dlrs it said cash flow per share this year should be 2 50 to three dlrs reuter 3\n",
  294. "y_train: 3\n",
  295. "-------------------------------------------------------------------------------\n",
  296. "<< index >> : 1\n",
  297. "[πŸƒ] generale de banque sa lt genb br and lt heller overseas corp of chicago have each taken 50 pct stakes in factoring company sa belgo factors generale de banque said in a statement it gave no financial details of the transaction sa belgo [❓] turnover in 1986 was 17 5 billion belgian francs reuter 3\n",
  298. "y_train: 4\n",
  299. "-------------------------------------------------------------------------------\n",
  300. "<< index >> : 2\n",
  301. "[πŸƒ] shr 3 28 dlrs vs 22 cts shr diluted 2 99 dlrs vs 22 cts net 46 0 mln vs 3 328 000 avg shrs 14 0 mln vs 15 2 mln year shr 5 41 dlrs vs 1 56 dlrs shr diluted 4 94 dlrs vs 1 50 dlrs net 78 2 mln vs 25 9 mln avg shrs 14 5 mln vs 15 1 mln note earnings per share reflect the two for one split effective january 6 1987 per share amounts are calculated after preferred stock dividends loss continuing operations for the qtr 1986 includes gains of sale of investments in enron corp of 14 mln dlrs and associated companies of 4 189 000 less writedowns of investments in national intergroup inc of 11 8 mln and [❓] corp of 15 6 mln reuter 3\n",
  302. "y_train: 3\n",
  303. "-------------------------------------------------------------------------------\n",
  304. "<< index >> : 3\n",
  305. "[πŸƒ] the farmers home administration the u s agriculture department's farm lending arm could lose about seven billion dlrs in outstanding principal on its severely delinquent borrowers or about one fourth of its farm loan portfolio the general accounting office gao said in remarks prepared for delivery to the senate agriculture committee brian crowley senior associate director of gao also said that a preliminary analysis of proposed changes in [❓] financial eligibility standards indicated as many as one half of fmha borrowers who received new loans from the agency in 1986 would be ineligible under the proposed system the agency has proposed evaluating [❓] credit using a variety of financial ratios instead of relying solely on cashflow ability senate agriculture committee chairman patrick leahy d vt [❓] the proposed eligibility changes telling fmha administrator [❓] clark at a hearing that they would mark a dramatic shift in the agency's purpose away from being farmers' lender of last resort toward becoming a big city bank but clark defended the new regulations saying the agency had a responsibility to administer its 70 billion dlr loan portfolio in a [❓] yet [❓] manner crowley of gao congress' investigative arm said the proposed credit [❓] system attempted to ensure that fmha would make loans only to borrowers who had a reasonable change of repaying their debt reuter 3\n",
  306. "y_train: 4\n",
  307. "-------------------------------------------------------------------------------\n",
  308. "<< index >> : 4\n",
  309. "[πŸƒ] seton co said its board has received a proposal from chairman and chief executive officer philip d kaltenbacher to acquire seton for 15 75 dlrs per share in cash seton said the acquisition bid is subject to kaltenbacher arranging the necessary financing it said he intends to ask other members of senior management to participate the company said kaltenbacher owns 30 pct of seton stock and other management members another 7 5 pct seton said it has formed an independent board committee to consider the offer and has deferred the annual meeting it had scheduled for march 31 reuter 3\n",
  310. "y_train: 4\n",
  311. "-------------------------------------------------------------------------------\n",
  312. "<< index >> : 5\n",
  313. "[πŸƒ] the u s agriculture department estimated canada's 1986 87 wheat crop at 31 85 mln tonnes vs 31 85 mln tonnes last month it estimated 1985 86 output at 24 25 mln tonnes vs 24 25 mln last month canadian 1986 87 coarse grain production is projected at 27 62 mln tonnes vs 27 62 mln tonnes last month production in 1985 86 is estimated at 24 95 mln tonnes vs 24 95 mln last month canadian wheat exports in 1986 87 are forecast at 19 00 mln tonnes vs 18 00 mln tonnes last month exports in 1985 86 are estimated at 17 71 mln tonnes vs 17 72 mln last month reuter 3\n",
  314. "y_train: 4\n",
  315. "-------------------------------------------------------------------------------\n",
  316. "<< index >> : 6\n",
  317. "[πŸƒ] lt qintex america ltd said it is again extending its offer of 13 dlrs a share for 3 3 mln princeville development corp shares until today from yesterday at midnight yesterday 7 242 117 princeville shares had been tendered up from 5 887 165 shares 24 hours earlier qintex said it is extending the offer to allow princeville to comply with federal law restricting the ownership of u s airlines by non u s citizens and to finalize the terms and conditions of the letter of credit or bank guarantee required under the previously announced acquisition agreement reuter 3\n",
  318. "y_train: 4\n",
  319. "-------------------------------------------------------------------------------\n",
  320. "<< index >> : 7\n",
  321. "[πŸƒ] shr 49 cts vs 39 cts net 886 937 vs 892 323 revs 25 9 mln vs 23 7 mln year shr 1 78 dlr vs 1 34 dlr net 3 254 301 vs 2 472 676 revs 100 6 mln vs 87 4 mln note 1986 4th qtr and year net includes income loss of metcap subsidiary of 14 881 dlrs and 311 848 dlrs or 17 cts per share respectively 1985 4th qtr and year net includes loss in metcap unit of 108 598 dlrs and 298 412 dlrs or 16 cts per share respectively reuter 3\n",
  322. "y_train: 3\n",
  323. "-------------------------------------------------------------------------------\n",
  324. "<< index >> : 8\n",
  325. "[πŸƒ] oper shr 23 cts vs 77 cts oper net 5 255 179 vs 17 6 mln revs 37 8 mln vs 73 7 mln note cash flow 19 5 mln dlrs or 86 cts shr vs 36 7 mln dlrs or 1 62 dlrs shr 1985 net excludes 32 ct shr loss from discontinued operations gross proven and probable reserves of crude oil and natural gas [❓] 18 4 mln barrels off 7 6 pct from a year before reuter 3\n",
  326. "y_train: 3\n",
  327. "-------------------------------------------------------------------------------\n",
  328. "<< index >> : 9\n",
  329. "[πŸƒ] lt aramco corp has accepted japanese nominations to lift a higher proportion of arab heavy crude oil under term contracts in july oil industry sources said japanese companies requested a ratio of 80 pct arab heavy to 20 pct arab light under a term contract agreement with aramco for 100 000 barrels per day the sources said the contractual ratio is 30 pct heavy crude to 70 pct light japanese demand for heavy crude oil has increased substantially since the all japan [❓] union ceased sailing into the northern mideast gulf last month causing problems with liftings of heavy kuwait and [❓] crudes reuter 3\n",
  330. "y_train: 16\n",
  331. "-------------------------------------------------------------------------------\n",
  332. "<< index >> : 10\n",
  333. "[πŸƒ] period ended december 31 shr profit 11 cts vs loss 24 cts net profit 224 271 vs loss 511 349 revs 7 258 688 vs 7 200 349 reuter 3\n",
  334. "y_train: 3\n",
  335. "-------------------------------------------------------------------------------\n",
  336. "<< index >> : 11\n",
  337. "[πŸƒ] lt international thomson organisation ltd said it will report financial results in u s funds rather than sterling beginning from jan 1 1987 it said the change will not be applied retroactively to prior financial periods the company said as a result of recent investments most of its assets now are located in the united states reuter 3\n",
  338. "y_train: 3\n",
  339. "-------------------------------------------------------------------------------\n",
  340. "<< index >> : 12\n",
  341. "[πŸƒ] northview corp said it reached an agreement in principal covering the acquisition of the company by privately held calmark financial corp the agreement calls for northview to make a self tender offer for all of its outstanding stock at a price of 22 dlrs per share in cash calmark headquartered in los angeles develops manages and syndicates real estate northview also said reuter 3\n",
  342. "y_train: 4\n",
  343. "-------------------------------------------------------------------------------\n",
  344. "<< index >> : 13\n",
  345. "[πŸƒ] federal reserve board governor robert heller said the banking system could be strengthened by permitting formation of financial services holding companies involved in areas like banking insurance real estate and securities in a speech prepared for delivery in new york to the bank and financial analysts' association heller said i believe that increased diversification along geographic and product lines is the key to strengthening the american banking system he said he supported the idea of financial services holding companies advocated by the association of bank holding companies in which regulation of various bank thrift insurance investment securities and real estate subsidiaries would be handled on functional lines limits would be placed on the extension of credit by the bank to the associated institutions and all transactions would have to be on an arms length basis heller said measures would be necessary to avoid abuse of the banks' special position by such holding companies or subsidiaries heller said he would require the holding company to serve as a [❓] of [❓] to the bank by making a commitment to maintain the bank's capital in other words the bank would not be allowed to fail as long as the holding company has a positive net worth heller also said commercial enterprises should be permitted to own a financial services holding company again with the provision that capital would flow to the financial enterprise if necessary heller said the effects of these actions would be banks that are at least as strong as the corporations holding them in which customer deposits were assured while any incentive to [❓] the bank was removed such diversification would give access to national and international financial services to corporations across the united states heller said that would mean the steady decline of america's banks in the world financial league tables would be arrested by permitting them to become more competitive reuter 3\n",
  346. "y_train: 4\n",
  347. "-------------------------------------------------------------------------------\n",
  348. "<< index >> : 14\n",
  349. "[πŸƒ] the dollar is expected to decline further in coming days as scepticism mounts about the effectiveness of last month's paris accord to stabilise currency exchange rates senior foreign exchange dealers said following its fall today to a record 148 40 yen dealers said they expect the dollar to establish a new trading range of 147 to 150 yen before the market again tries to push it down behind the latest dollar fall lies the belief that last month's accord was no longer enough to stop operators pushing the dollar down the dealers said the recent remark by u s treasury secretary james baker that the paris accord did not set any target ranges for major currencies has cast a shadow on the agreement said koji kidokoro general manager of mitsui bank ltd's treasury division he said the market interpreted this as indicating the u s would favour a weaker dollar and it had little intention of intervening to support the currency this eliminated the widespread market caution against possible joint central bank intervention kidokoro said dealers said the dollar had gathered renewed downward momentum and that bank of japan intervention alone could hardly contain a further slide in the currency they said the central bank bought between one to 1 5 billion dlrs today including direct purchases through brokers and yesterday it might have bought a small amount of dollars through the u s central bank in new york most dealers said they doubted the u s federal reserve would intervene on its own account to support the dollar but some said this might occur if the dollar fell much below 148 yen if the dollar drops to that low level it could reduce the flow of foreign capital into u s securities which the americans don't want said haruya uehara chief money market manager of mitsubishi trust and banking corp he said the dollar may return to around 152 yen next month when corporations reduce their dollar sales after they close their books for the 1986 87 business year ending on march 31 but dealers said the longer term outlook for the dollar remained bearish this was due to the lacklustre performance of the u s economy the continuing u s trade deficit and japanese delays in announcing an economic stimulation package the americans are getting frustrated at japan's inertia in stimulating its economy said hirozumi tanaka assistant general manager of dai ichi kangyo bank ltd's international treasury division in the paris currency accord japan promised a package of economic measures after the fiscal 1987 budget was passed to boost domestic demand increase imports and thus reduce its trade surplus the package was expected in april but debate on the budget has been delayed by an opposition boycott of parliamentary business over the proposed introduction of a sales tax in the circumstances the government had only a slim chance of producing a meaningful economic package in the near future dai ichi kangyo's tanaka said dealers said if steps are not taken to stimulate the japanese economy protectionist sentiment in the u s congress would grow and put more downward pressure on the dollar reuter 3\n",
  350. "y_train: 19\n",
  351. "-------------------------------------------------------------------------------\n",
  352. "<< index >> : 15\n",
  353. "[πŸƒ] commercial and industrial loans on the books of the 10 major new york banks excluding acceptances fell 572 mln dlrs to 64 297 billion in the week ended march 11 the federal reserve bank of new york said including acceptances loans fell 475 mln dlrs to 65 16 billion commercial paper outstanding nationally increased 2 98 billion dlrs to 339 00 billion national business loan data are scheduled to be released on friday reuter 3\n",
  354. "y_train: 8\n",
  355. "-------------------------------------------------------------------------------\n",
  356. "<< index >> : 16\n",
  357. "[πŸƒ] standard oil co said a contract has been awarded to lt cbs engineering inc for a drilling and production platform to be installed in [❓] bank block 826 in the gulf of mexico where standard and mobil corp each own a 40 pct interest standard said its standard oil production co subsidiary will operate the platform which is being designed to produce 15 000 barrels of oil and 50 mln cubic feet of gas daily the platform is now expected to be installed in the summer of 1988 other owners are kerr [❓] corp lt kmg with 16 66 pct and lt prudential insurance co of america with 3 34 pct reuter 3\n",
  358. "y_train: 16\n",
  359. "-------------------------------------------------------------------------------\n",
  360. "<< index >> : 17\n",
  361. "[πŸƒ] qtly div 72 cts vs 70 cts prior payable june 10 record may 15 reuter 3\n",
  362. "y_train: 3\n",
  363. "-------------------------------------------------------------------------------\n",
  364. "<< index >> : 18\n",
  365. "[πŸƒ] shr 1 24 dlrs vs 19 cts shr diluted 1 11 dlrs vs 19 cts net 11 9 mln vs 1 830 000 revs 79 3 mln vs 46 1 mln note 1986 net includes pretax charge 8 300 000 dlrs from increases and reserves and writeoffs of low yielding assets and pretax gain 20 8 mln dlrs from sale of multi family subsidiary another 3 800 000 dlrs of gain from the multi family sale will be recognized in 1987 if multi family meets targeted operating results reuter 3\n",
  366. "y_train: 3\n",
  367. "-------------------------------------------------------------------------------\n",
  368. "<< index >> : 19\n",
  369. "[πŸƒ] austrian gross domestic product growth for this year is likely to be between 0 5 and 1 5 pct helmut kramer head of the semi official institute for economic research wifo said this compared with a two pct growth forecast made by the wifo last december kramer made the forecast at a meeting today on austria's economic outlook also attended by chancellor franz vranitzky finance minister ferdinand lacina and national bank president stefan koren reuter 3\n",
  370. "y_train: 21\n",
  371. "-------------------------------------------------------------------------------\n"
  372. ]
  373. }
  374. ],
  375. "source": [
  376. "# Print Original Texts\n",
  377. "for i in index_list:\n",
  378. " print('<< index >> :', i)\n",
  379. " print(restore_original_text(i))\n",
  380. " print('y_train:', y_train[i])\n",
  381. " print('-------------------------------------------------------------------------------')"
  382. ]
  383. },
  384. {
  385. "cell_type": "code",
  386. "execution_count": null,
  387. "metadata": {
  388. "collapsed": true
  389. },
  390. "outputs": [],
  391. "source": []
  392. }
  393. ],
  394. "metadata": {
  395. "kernelspec": {
  396. "display_name": "Python 3",
  397. "language": "python",
  398. "name": "python3"
  399. },
  400. "language_info": {
  401. "codemirror_mode": {
  402. "name": "ipython",
  403. "version": 3
  404. },
  405. "file_extension": ".py",
  406. "mimetype": "text/x-python",
  407. "name": "python",
  408. "nbconvert_exporter": "python",
  409. "pygments_lexer": "ipython3",
  410. "version": "3.5.1"
  411. }
  412. },
  413. "nbformat": 4,
  414. "nbformat_minor": 0
  415. }
Add Comment
Please, Sign In to add comment