noshot 0.1.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. noshot/__init__.py +1 -0
  2. noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(A) Breadth First Search.ipynb +112 -0
  3. noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(B) Depth First Search.ipynb +111 -0
  4. noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(C) Uniform Cost Search.ipynb +134 -0
  5. noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(D) Depth Limites Search.ipynb +115 -0
  6. noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(E) Iterative Deepening DFS.ipynb +123 -0
  7. noshot/data/AIDS CN NLP/AIDS/10. ANOVA/2_ANOVA.csv +769 -0
  8. noshot/data/AIDS CN NLP/AIDS/10. ANOVA/One Way ANOVA (Repeated Measure).ipynb +126 -0
  9. noshot/data/AIDS CN NLP/AIDS/10. ANOVA/One Way ANOVA.ipynb +134 -0
  10. noshot/data/AIDS CN NLP/AIDS/10. ANOVA/Sample 1 Way ANOVA Test.ipynb +119 -0
  11. noshot/data/AIDS CN NLP/AIDS/10. ANOVA/Two Way ANOVA.ipynb +138 -0
  12. noshot/data/AIDS CN NLP/AIDS/10. ANOVA/reaction_time.csv +5 -0
  13. noshot/data/AIDS CN NLP/AIDS/10. ANOVA/sample_data.csv +16 -0
  14. noshot/data/AIDS CN NLP/AIDS/10. ANOVA/sleep_deprivation.csv +4 -0
  15. noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/3_Linear.csv +4802 -0
  16. noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/Linear Regression LAB.ipynb +113 -0
  17. noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/Linear Regression New- sklearn.ipynb +118 -0
  18. noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/Linear Regression.ipynb +148 -0
  19. noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/house_rate.csv +22 -0
  20. noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/Logistic Regression New- sklearn.ipynb +128 -0
  21. noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/Logistic Regression.ipynb +145 -0
  22. noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/default.csv +1001 -0
  23. noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/hours_scores_records.csv +101 -0
  24. noshot/data/AIDS CN NLP/AIDS/2. Implement A Star And MA Star/(A) Astar.ipynb +256 -0
  25. noshot/data/AIDS CN NLP/AIDS/2. Implement A Star And MA Star/(B) IDAstar.ipynb +157 -0
  26. noshot/data/AIDS CN NLP/AIDS/2. Implement A Star And MA Star/(C) SMAstar.ipynb +178 -0
  27. noshot/data/AIDS CN NLP/AIDS/3. Genetic Algorithm/Genetic.ipynb +95 -0
  28. noshot/data/AIDS CN NLP/AIDS/4. Simulated Annealing/Simulated Annealing.ipynb +74 -0
  29. noshot/data/AIDS CN NLP/AIDS/4. Simulated Annealing/Sudoku Simulated Annealing.ipynb +103 -0
  30. noshot/data/AIDS CN NLP/AIDS/5. Alpha Beta Pruning/AlphaBetaPruning.ipynb +182 -0
  31. noshot/data/AIDS CN NLP/AIDS/6. Consraint Satisfaction Problems (CSP)/(A) CSP House Allocation.ipynb +120 -0
  32. noshot/data/AIDS CN NLP/AIDS/6. Consraint Satisfaction Problems (CSP)/(B) CSP Map Coloring.ipynb +125 -0
  33. noshot/data/AIDS CN NLP/AIDS/7. Random Sampling/Random Sampling.ipynb +73 -0
  34. noshot/data/AIDS CN NLP/AIDS/7. Random Sampling/height_weight_bmi.csv +8389 -0
  35. noshot/data/AIDS CN NLP/AIDS/8. Z Test/Z Test Hash Function.ipynb +141 -0
  36. noshot/data/AIDS CN NLP/AIDS/8. Z Test/Z Test.ipynb +151 -0
  37. noshot/data/AIDS CN NLP/AIDS/8. Z Test/height_weight_bmi.csv +8389 -0
  38. noshot/data/AIDS CN NLP/AIDS/9. T Test/1_heart.csv +304 -0
  39. noshot/data/AIDS CN NLP/AIDS/9. T Test/Independent T Test.ipynb +119 -0
  40. noshot/data/AIDS CN NLP/AIDS/9. T Test/Paired T Test.ipynb +118 -0
  41. noshot/data/AIDS CN NLP/AIDS/9. T Test/T Test Hash Function.ipynb +142 -0
  42. noshot/data/AIDS CN NLP/AIDS/9. T Test/T Test.ipynb +158 -0
  43. noshot/data/AIDS CN NLP/AIDS/9. T Test/height_weight_bmi.csv +8389 -0
  44. noshot/data/AIDS CN NLP/AIDS/9. T Test/iq_test.csv +0 -0
  45. noshot/data/AIDS CN NLP/AIDS/Others (AllinOne)/All In One.ipynb +4581 -0
  46. noshot/data/AIDS CN NLP/CN/1. Chat Application/chat.java +81 -0
  47. noshot/data/AIDS CN NLP/CN/1. Chat Application/output.png +0 -0
  48. noshot/data/AIDS CN NLP/CN/1. Chat Application/procedure.png +0 -0
  49. noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/LAN.tcl +65 -0
  50. noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/analysis.awk +44 -0
  51. noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/output.png +0 -0
  52. noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/procedure.png +0 -0
  53. noshot/data/AIDS CN NLP/CN/11. Wireless LAN IEEE 802.11/complexdcf.tcl +229 -0
  54. noshot/data/AIDS CN NLP/CN/11. Wireless LAN IEEE 802.11/output.png +0 -0
  55. noshot/data/AIDS CN NLP/CN/11. Wireless LAN IEEE 802.11/procedure.png +0 -0
  56. noshot/data/AIDS CN NLP/CN/2. File Transfer/file_to_send.txt +2 -0
  57. noshot/data/AIDS CN NLP/CN/2. File Transfer/filetransfer.java +119 -0
  58. noshot/data/AIDS CN NLP/CN/2. File Transfer/output.png +0 -0
  59. noshot/data/AIDS CN NLP/CN/2. File Transfer/procedure.png +0 -0
  60. noshot/data/AIDS CN NLP/CN/3. RMI (Remote Method Invocation)/output.png +0 -0
  61. noshot/data/AIDS CN NLP/CN/3. RMI (Remote Method Invocation)/procedure.png +0 -0
  62. noshot/data/AIDS CN NLP/CN/3. RMI (Remote Method Invocation)/rmi.java +56 -0
  63. noshot/data/AIDS CN NLP/CN/4. Wired Network/output.png +0 -0
  64. noshot/data/AIDS CN NLP/CN/4. Wired Network/procedure.png +0 -0
  65. noshot/data/AIDS CN NLP/CN/4. Wired Network/wired.awk +25 -0
  66. noshot/data/AIDS CN NLP/CN/4. Wired Network/wired.tcl +81 -0
  67. noshot/data/AIDS CN NLP/CN/5. Wireless Network/output.png +0 -0
  68. noshot/data/AIDS CN NLP/CN/5. Wireless Network/procedure.png +0 -0
  69. noshot/data/AIDS CN NLP/CN/5. Wireless Network/wireless.awk +27 -0
  70. noshot/data/AIDS CN NLP/CN/5. Wireless Network/wireless.tcl +153 -0
  71. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/analysis.awk +27 -0
  72. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/output.png +0 -0
  73. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/sack.tcl +86 -0
  74. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/vegas.tcl +86 -0
  75. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/analysis.awk +28 -0
  76. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/output.png +0 -0
  77. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/reno.tcl +78 -0
  78. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/tahoe.tcl +79 -0
  79. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Flow Control/analysis.awk +27 -0
  80. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Flow Control/flow.tcl +163 -0
  81. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Flow Control/output.png +0 -0
  82. noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/procedure.png +0 -0
  83. noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/DV.tcl +111 -0
  84. noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/LS.tcl +106 -0
  85. noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/analysis.awk +36 -0
  86. noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/output.png +0 -0
  87. noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/procedure.png +0 -0
  88. noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/analysis.awk +20 -0
  89. noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/broadcast.tcl +76 -0
  90. noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/multicast.tcl +103 -0
  91. noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/output.png +0 -0
  92. noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/procedure.png +0 -0
  93. noshot/data/AIDS CN NLP/CN/9. DHCP/DHCP.java +125 -0
  94. noshot/data/AIDS CN NLP/CN/9. DHCP/output.png +0 -0
  95. noshot/data/AIDS CN NLP/CN/9. DHCP/procedure.png +0 -0
  96. noshot/data/AIDS CN NLP/NLP/NLP 1/1-Prereqs.py +18 -0
  97. noshot/data/AIDS CN NLP/NLP/NLP 1/2-Chi2test.py +83 -0
  98. noshot/data/AIDS CN NLP/NLP/NLP 1/2-T-test.py +79 -0
  99. noshot/data/AIDS CN NLP/NLP/NLP 1/3-WSD-nb.py +53 -0
  100. noshot/data/AIDS CN NLP/NLP/NLP 1/4-Hindle-Rooth.py +53 -0
  101. noshot/data/AIDS CN NLP/NLP/NLP 1/5-HMM-Trellis.py +82 -0
  102. noshot/data/AIDS CN NLP/NLP/NLP 1/6-HMM-Viterbi.py +16 -0
  103. noshot/data/AIDS CN NLP/NLP/NLP 1/7-PCFG-parsetree.py +15 -0
  104. noshot/data/AIDS CN NLP/NLP/NLP 1/Chi2test.ipynb +285 -0
  105. noshot/data/AIDS CN NLP/NLP/NLP 1/Hindle-Rooth.ipynb +179 -0
  106. noshot/data/AIDS CN NLP/NLP/NLP 1/Lab 10 - Text generator using LSTM.ipynb +1461 -0
  107. noshot/data/AIDS CN NLP/NLP/NLP 1/Lab 11 NMT.ipynb +2307 -0
  108. noshot/data/AIDS CN NLP/NLP/NLP 1/PCFG.ipynb +134 -0
  109. noshot/data/AIDS CN NLP/NLP/NLP 1/Prereqs.ipynb +131 -0
  110. noshot/data/AIDS CN NLP/NLP/NLP 1/T test.ipynb +252 -0
  111. noshot/data/AIDS CN NLP/NLP/NLP 1/TFIDF BOW.ipynb +171 -0
  112. noshot/data/AIDS CN NLP/NLP/NLP 1/Trellis.ipynb +244 -0
  113. noshot/data/AIDS CN NLP/NLP/NLP 1/WSD.ipynb +645 -0
  114. noshot/data/AIDS CN NLP/NLP/NLP 1/Word2Vec.ipynb +93 -0
  115. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab01(tokenizer)/tokenizer.ipynb +370 -0
  116. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab01(tokenizer)/training_tokenizer.txt +6 -0
  117. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/exp0.ipynb +274 -0
  118. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/lab2.ipynb +905 -0
  119. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/test.txt +1 -0
  120. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/tokenizing.ipynb +272 -0
  121. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab03(parse-tree)/collocation.ipynb +332 -0
  122. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab03(parse-tree)/lab3.ipynb +549 -0
  123. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab03(parse-tree)/nlp.txt +1 -0
  124. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab04(collocation)/Lab4-NLP-Exp-2.ipynb +817 -0
  125. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab04(collocation)/collocation.ipynb +332 -0
  126. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab05(WSD)/NLP-Lab-5-Exp3.ipynb +231 -0
  127. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab05(WSD)/word-sense-disambiguation.ipynb +507 -0
  128. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab06(additional-exercise)/lab6.ipynb +134 -0
  129. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab07(HMM,Viterbi)/NLP Exp 4.ipynb +255 -0
  130. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab07(HMM,Viterbi)/NLP_Exp_5.ipynb +159 -0
  131. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab08(PCFG)/PCFG.ipynb +282 -0
  132. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab09-Hindle-rooth&MLP/Lab 9 - MLP classifier.ipynb +670 -0
  133. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab09-Hindle-rooth&MLP/MLP-alternative-code.ipynb +613 -0
  134. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab09-Hindle-rooth&MLP/hindle-rooth-algorithm.ipynb +74 -0
  135. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab10(LSTM)/Lab_10_Text_generator_using_LSTM.ipynb +480 -0
  136. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/Machine-translation.ipynb +445 -0
  137. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/Viterbi-PCFG.ipynb +105 -0
  138. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/corpora_tools.py +87 -0
  139. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/data_utils.py +11 -0
  140. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/train_translator.py +83 -0
  141. noshot/data/AIDS CN NLP/NLP/NLP 2/Lab12(Information-Extraction)/Information_Extraction.ipynb +201 -0
  142. noshot/data/AIDS CN NLP/NLP/NLP 3/Backtrack-without-Verbitri.ipynb +185 -0
  143. noshot/data/AIDS CN NLP/NLP/NLP 3/Backward-Procedure.ipynb +597 -0
  144. noshot/data/AIDS CN NLP/NLP/NLP 3/Bag_of.ipynb +1422 -0
  145. noshot/data/AIDS CN NLP/NLP/NLP 3/CYK-algorithm.ipynb +1067 -0
  146. noshot/data/AIDS CN NLP/NLP/NLP 3/Forward-Procedure.ipynb +477 -0
  147. noshot/data/AIDS CN NLP/NLP/NLP 3/LSTM.ipynb +1290 -0
  148. noshot/data/AIDS CN NLP/NLP/NLP 3/Lab 10 - Text generator using LSTM.ipynb +1461 -0
  149. noshot/data/AIDS CN NLP/NLP/NLP 3/Lab 11 NMT.ipynb +2307 -0
  150. noshot/data/AIDS CN NLP/NLP/NLP 3/NLP-LAB-4.ipynb +216 -0
  151. noshot/data/AIDS CN NLP/NLP/NLP 3/NLP-LAB-5.ipynb +216 -0
  152. noshot/data/AIDS CN NLP/NLP/NLP 3/abc.txt +6 -0
  153. noshot/data/AIDS CN NLP/NLP/NLP 3/ex-1-nltk.ipynb +711 -0
  154. noshot/data/AIDS CN NLP/NLP/NLP 3/ex-2-nlp.ipynb +267 -0
  155. noshot/data/AIDS CN NLP/NLP/NLP 3/exp8&9.ipynb +305 -0
  156. noshot/data/AIDS CN NLP/NLP/NLP 3/hind.ipynb +287 -0
  157. noshot/data/AIDS CN NLP/NLP/NLP 3/lab66.ipynb +752 -0
  158. noshot/data/AIDS CN NLP/NLP/NLP 3/leb_3.ipynb +612 -0
  159. noshot/data/AIDS CN NLP/NLP/NLP 3/naive_bayes_classifier.pkl +0 -0
  160. noshot/data/AIDS CN NLP/NLP/NLP 3/nlp_leb_1.ipynb +3008 -0
  161. noshot/data/AIDS CN NLP/NLP/NLP 3/nlp_leb_2.ipynb +3095 -0
  162. noshot/data/AIDS CN NLP/NLP/NLP 3/nlplab-9.ipynb +295 -0
  163. noshot/data/AIDS CN NLP/NLP/NLP 3/nltk-ex-4.ipynb +506 -0
  164. noshot/data/AIDS CN NLP/NLP/NLP 3/text1.txt +48 -0
  165. noshot/data/AIDS CN NLP/NLP/NLP 3/text2.txt +8 -0
  166. noshot/data/AIDS CN NLP/NLP/NLP 3/text3.txt +48 -0
  167. noshot/data/AIDS CN NLP/NLP/NLP 3/translation-rnn.ipynb +812 -0
  168. noshot/data/AIDS CN NLP/NLP/NLP 3/word2vector.ipynb +173 -0
  169. noshot/data/AIDS CN NLP/NLP/NLP 4/Backward Procedure Algorithm.ipynb +179 -0
  170. noshot/data/AIDS CN NLP/NLP/NLP 4/Chi Square Collocation.ipynb +208 -0
  171. noshot/data/AIDS CN NLP/NLP/NLP 4/Collocation (T test).ipynb +188 -0
  172. noshot/data/AIDS CN NLP/NLP/NLP 4/Experiment 1.ipynb +437 -0
  173. noshot/data/AIDS CN NLP/NLP/NLP 4/Forward Procedure Algorithm.ipynb +132 -0
  174. noshot/data/AIDS CN NLP/NLP/NLP 4/Hindle Rooth.ipynb +414 -0
  175. noshot/data/AIDS CN NLP/NLP/NLP 4/MachineTranslation.ipynb +368 -0
  176. noshot/data/AIDS CN NLP/NLP/NLP 4/Multi Layer Perceptron using MLPClassifier.ipynb +86 -0
  177. noshot/data/AIDS CN NLP/NLP/NLP 4/Multi Layer Perceptron using Tensorflow.ipynb +112 -0
  178. noshot/data/AIDS CN NLP/NLP/NLP 4/PCFG Inside Probability.ipynb +451 -0
  179. noshot/data/AIDS CN NLP/NLP/NLP 4/Text Generation using LSTM.ipynb +297 -0
  180. noshot/data/AIDS CN NLP/NLP/NLP 4/Viterbi.ipynb +310 -0
  181. noshot/data/AIDS CN NLP/NLP/NLP 4/Word Sense Disambiguation.ipynb +335 -0
  182. noshot/data/AIDS CN NLP/NLP/NLP 5/10.Text Generation using LSTM.ipynb +316 -0
  183. noshot/data/AIDS CN NLP/NLP/NLP 5/11.Machine Translation.ipynb +868 -0
  184. noshot/data/AIDS CN NLP/NLP/NLP 5/2.T and Chi2 Test.ipynb +204 -0
  185. noshot/data/AIDS CN NLP/NLP/NLP 5/3.Word Sense Diambiguation.ipynb +234 -0
  186. noshot/data/AIDS CN NLP/NLP/NLP 5/4.Hinddle and Rooth.ipynb +128 -0
  187. noshot/data/AIDS CN NLP/NLP/NLP 5/5.Forward and Backward.ipynb +149 -0
  188. noshot/data/AIDS CN NLP/NLP/NLP 5/6.Viterbi.ipynb +111 -0
  189. noshot/data/AIDS CN NLP/NLP/NLP 5/7.PCFG Parse Tree.ipynb +134 -0
  190. noshot/data/AIDS CN NLP/NLP/NLP 5/7.PCFG using cyk.ipynb +101 -0
  191. noshot/data/AIDS CN NLP/NLP/NLP 5/8.Bag of words and TF-IDF.ipynb +310 -0
  192. noshot/data/AIDS CN NLP/NLP/NLP 5/9.Word2Vector.ipynb +78 -0
  193. noshot/data/AIDS CN NLP/NLP/NLP 5/NLP ALL In One.ipynb +2619 -0
  194. noshot/data/AIDS CN NLP/NLP/NLP 5/sample1.txt +15 -0
  195. noshot/data/AIDS CN NLP/NLP/NLP 5/sample2.txt +4 -0
  196. noshot/data/AIDS CN NLP/NLP/NLP 5/word2vec_model.bin +0 -0
  197. noshot/data/AIDS CN NLP/NLP/NLP 6/1. Tokenize, Tagging, NER, Parse Tree.ipynb +312 -0
  198. noshot/data/AIDS CN NLP/NLP/NLP 6/2. T Test and Chi2 Test.ipynb +185 -0
  199. noshot/data/AIDS CN NLP/NLP/NLP 6/3. Naive Bayes WSD.ipynb +199 -0
  200. noshot/data/AIDS CN NLP/NLP/NLP 6/4. Hinddle and Rooth.ipynb +151 -0
  201. noshot/data/AIDS CN NLP/NLP/NLP 6/5 and 6 FWD, BWD, Viterbi.ipynb +164 -0
  202. noshot/data/AIDS CN NLP/NLP/NLP 6/7. PCFG using CYK.ipynb +383 -0
  203. noshot/data/AIDS CN NLP/NLP/NLP 6/8. BOW and TF-IDF.ipynb +252 -0
  204. noshot/data/AIDS CN NLP/Ubuntu CN Lab.iso +0 -0
  205. noshot/main.py +47 -0
  206. noshot-0.1.0.dist-info/LICENSE.txt +21 -0
  207. noshot-0.1.0.dist-info/METADATA +65 -0
  208. noshot-0.1.0.dist-info/RECORD +210 -0
  209. noshot-0.1.0.dist-info/WHEEL +5 -0
  210. noshot-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,645 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 50,
6
+ "metadata": {},
7
+ "outputs": [],
8
+ "source": [
9
+ "import pandas as pd\n",
10
+ "import numpy as np\n",
11
+ "from nltk.util import bigrams\n",
12
+ "from nltk.corpus import stopwords\n",
13
+ "from nltk.tokenize import word_tokenize\n",
14
+ "import string"
15
+ ]
16
+ },
17
+ {
18
+ "cell_type": "code",
19
+ "execution_count": 51,
20
+ "metadata": {},
21
+ "outputs": [
22
+ {
23
+ "data": {
24
+ "text/html": [
25
+ "<div>\n",
26
+ "<style scoped>\n",
27
+ " .dataframe tbody tr th:only-of-type {\n",
28
+ " vertical-align: middle;\n",
29
+ " }\n",
30
+ "\n",
31
+ " .dataframe tbody tr th {\n",
32
+ " vertical-align: top;\n",
33
+ " }\n",
34
+ "\n",
35
+ " .dataframe thead th {\n",
36
+ " text-align: right;\n",
37
+ " }\n",
38
+ "</style>\n",
39
+ "<table border=\"1\" class=\"dataframe\">\n",
40
+ " <thead>\n",
41
+ " <tr style=\"text-align: right;\">\n",
42
+ " <th></th>\n",
43
+ " <th>Sentence</th>\n",
44
+ " <th>Class</th>\n",
45
+ " </tr>\n",
46
+ " </thead>\n",
47
+ " <tbody>\n",
48
+ " <tr>\n",
49
+ " <th>0</th>\n",
50
+ " <td>I deposited my paycheck at the bank.</td>\n",
51
+ " <td>Financial Institution</td>\n",
52
+ " </tr>\n",
53
+ " <tr>\n",
54
+ " <th>1</th>\n",
55
+ " <td>The bank of the river was eroded by the heavy ...</td>\n",
56
+ " <td>River Border</td>\n",
57
+ " </tr>\n",
58
+ " <tr>\n",
59
+ " <th>2</th>\n",
60
+ " <td>She works at the bank as a teller.</td>\n",
61
+ " <td>Financial Institution</td>\n",
62
+ " </tr>\n",
63
+ " <tr>\n",
64
+ " <th>3</th>\n",
65
+ " <td>Let's have a picnic by the bank of the river.</td>\n",
66
+ " <td>River Border</td>\n",
67
+ " </tr>\n",
68
+ " <tr>\n",
69
+ " <th>4</th>\n",
70
+ " <td>The bank approved my loan application.</td>\n",
71
+ " <td>Financial Institution</td>\n",
72
+ " </tr>\n",
73
+ " </tbody>\n",
74
+ "</table>\n",
75
+ "</div>"
76
+ ],
77
+ "text/plain": [
78
+ " Sentence Class\n",
79
+ "0 I deposited my paycheck at the bank. Financial Institution\n",
80
+ "1 The bank of the river was eroded by the heavy ... River Border\n",
81
+ "2 She works at the bank as a teller. Financial Institution\n",
82
+ "3 Let's have a picnic by the bank of the river. River Border\n",
83
+ "4 The bank approved my loan application. Financial Institution"
84
+ ]
85
+ },
86
+ "execution_count": 51,
87
+ "metadata": {},
88
+ "output_type": "execute_result"
89
+ }
90
+ ],
91
+ "source": [
92
+ "df = pd.read_csv(\"../Bank.csv\")\n",
93
+ "df = df.iloc[:94]\n",
94
+ "df.head()"
95
+ ]
96
+ },
97
+ {
98
+ "cell_type": "code",
99
+ "execution_count": 52,
100
+ "metadata": {},
101
+ "outputs": [],
102
+ "source": [
103
+ "stops = set(stopwords.words(\"english\"))"
104
+ ]
105
+ },
106
+ {
107
+ "cell_type": "code",
108
+ "execution_count": 53,
109
+ "metadata": {},
110
+ "outputs": [
111
+ {
112
+ "data": {
113
+ "text/html": [
114
+ "<div>\n",
115
+ "<style scoped>\n",
116
+ " .dataframe tbody tr th:only-of-type {\n",
117
+ " vertical-align: middle;\n",
118
+ " }\n",
119
+ "\n",
120
+ " .dataframe tbody tr th {\n",
121
+ " vertical-align: top;\n",
122
+ " }\n",
123
+ "\n",
124
+ " .dataframe thead th {\n",
125
+ " text-align: right;\n",
126
+ " }\n",
127
+ "</style>\n",
128
+ "<table border=\"1\" class=\"dataframe\">\n",
129
+ " <thead>\n",
130
+ " <tr style=\"text-align: right;\">\n",
131
+ " <th></th>\n",
132
+ " <th>Sentence</th>\n",
133
+ " <th>Class</th>\n",
134
+ " </tr>\n",
135
+ " </thead>\n",
136
+ " <tbody>\n",
137
+ " <tr>\n",
138
+ " <th>0</th>\n",
139
+ " <td>[deposited, paycheck, bank]</td>\n",
140
+ " <td>Financial Institution</td>\n",
141
+ " </tr>\n",
142
+ " <tr>\n",
143
+ " <th>1</th>\n",
144
+ " <td>[bank, river, eroded, heavy, rains]</td>\n",
145
+ " <td>River Border</td>\n",
146
+ " </tr>\n",
147
+ " <tr>\n",
148
+ " <th>2</th>\n",
149
+ " <td>[works, bank, teller]</td>\n",
150
+ " <td>Financial Institution</td>\n",
151
+ " </tr>\n",
152
+ " <tr>\n",
153
+ " <th>3</th>\n",
154
+ " <td>[let, 's, picnic, bank, river]</td>\n",
155
+ " <td>River Border</td>\n",
156
+ " </tr>\n",
157
+ " <tr>\n",
158
+ " <th>4</th>\n",
159
+ " <td>[bank, approved, loan, application]</td>\n",
160
+ " <td>Financial Institution</td>\n",
161
+ " </tr>\n",
162
+ " </tbody>\n",
163
+ "</table>\n",
164
+ "</div>"
165
+ ],
166
+ "text/plain": [
167
+ " Sentence Class\n",
168
+ "0 [deposited, paycheck, bank] Financial Institution\n",
169
+ "1 [bank, river, eroded, heavy, rains] River Border\n",
170
+ "2 [works, bank, teller] Financial Institution\n",
171
+ "3 [let, 's, picnic, bank, river] River Border\n",
172
+ "4 [bank, approved, loan, application] Financial Institution"
173
+ ]
174
+ },
175
+ "execution_count": 53,
176
+ "metadata": {},
177
+ "output_type": "execute_result"
178
+ }
179
+ ],
180
+ "source": [
181
+ "for _,row in df.iterrows():\n",
182
+ " row[\"Sentence\"] = row[\"Sentence\"].lower()\n",
183
+ " row[\"Sentence\"] = word_tokenize(row[\"Sentence\"])\n",
184
+ " row[\"Sentence\"] = [i for i in row[\"Sentence\"] if i not in stops and i not in string.punctuation]\n",
185
+ "df.head()"
186
+ ]
187
+ },
188
+ {
189
+ "cell_type": "code",
190
+ "execution_count": 54,
191
+ "metadata": {},
192
+ "outputs": [
193
+ {
194
+ "data": {
195
+ "text/plain": [
196
+ "[['deposited', 'paycheck', 'bank'],\n",
197
+ " ['bank', 'river', 'eroded', 'heavy', 'rains'],\n",
198
+ " ['works', 'bank', 'teller'],\n",
199
+ " ['let', \"'s\", 'picnic', 'bank', 'river'],\n",
200
+ " ['bank', 'approved', 'loan', 'application']]"
201
+ ]
202
+ },
203
+ "execution_count": 54,
204
+ "metadata": {},
205
+ "output_type": "execute_result"
206
+ }
207
+ ],
208
+ "source": [
209
+ "sentences = df[\"Sentence\"]\n",
210
+ "sentences = sentences.tolist()\n",
211
+ "sentences[:5]"
212
+ ]
213
+ },
214
+ {
215
+ "cell_type": "code",
216
+ "execution_count": 55,
217
+ "metadata": {},
218
+ "outputs": [
219
+ {
220
+ "data": {
221
+ "text/plain": [
222
+ "['Financial Institution',\n",
223
+ " 'River Border',\n",
224
+ " 'Financial Institution',\n",
225
+ " 'River Border',\n",
226
+ " 'Financial Institution']"
227
+ ]
228
+ },
229
+ "execution_count": 55,
230
+ "metadata": {},
231
+ "output_type": "execute_result"
232
+ }
233
+ ],
234
+ "source": [
235
+ "classes = df[\"Class\"]\n",
236
+ "classes = classes.tolist()\n",
237
+ "classes[:5]"
238
+ ]
239
+ },
240
+ {
241
+ "cell_type": "markdown",
242
+ "metadata": {},
243
+ "source": [
244
+ "## Class Frequency Counters"
245
+ ]
246
+ },
247
+ {
248
+ "cell_type": "code",
249
+ "execution_count": 56,
250
+ "metadata": {},
251
+ "outputs": [],
252
+ "source": [
253
+ "from collections import defaultdict"
254
+ ]
255
+ },
256
+ {
257
+ "cell_type": "code",
258
+ "execution_count": 57,
259
+ "metadata": {},
260
+ "outputs": [],
261
+ "source": [
262
+ "F_freq = defaultdict(int)\n",
263
+ "R_freq = defaultdict(int)\n",
264
+ "length = 0\n",
265
+ "F_counter = 0\n",
266
+ "R_counter = 0"
267
+ ]
268
+ },
269
+ {
270
+ "cell_type": "code",
271
+ "execution_count": 58,
272
+ "metadata": {},
273
+ "outputs": [
274
+ {
275
+ "data": {
276
+ "text/plain": [
277
+ "(45, 48)"
278
+ ]
279
+ },
280
+ "execution_count": 58,
281
+ "metadata": {},
282
+ "output_type": "execute_result"
283
+ }
284
+ ],
285
+ "source": [
286
+ "for i in range(94):\n",
287
+ " length = length + 1\n",
288
+ " if classes[i] == \"Financial Institution\":\n",
289
+ " F_counter += 1\n",
290
+ "\n",
291
+ " for j in sentences[i]:\n",
292
+ " F_freq[j] += 1\n",
293
+ " if classes[i] == \"River Border\":\n",
294
+ " R_counter += 1\n",
295
+ "\n",
296
+ " for j in sentences[i]:\n",
297
+ " F_freq[j] += 1 \n",
298
+ "F_counter, R_counter"
299
+ ]
300
+ },
301
+ {
302
+ "cell_type": "markdown",
303
+ "metadata": {},
304
+ "source": [
305
+ "### Priors"
306
+ ]
307
+ },
308
+ {
309
+ "cell_type": "code",
310
+ "execution_count": 59,
311
+ "metadata": {},
312
+ "outputs": [],
313
+ "source": [
314
+ "import math"
315
+ ]
316
+ },
317
+ {
318
+ "cell_type": "code",
319
+ "execution_count": 60,
320
+ "metadata": {},
321
+ "outputs": [
322
+ {
323
+ "data": {
324
+ "text/plain": [
325
+ "(-1.0473057147783567, -0.9541963103868752)"
326
+ ]
327
+ },
328
+ "execution_count": 60,
329
+ "metadata": {},
330
+ "output_type": "execute_result"
331
+ }
332
+ ],
333
+ "source": [
334
+ "total_classes = F_counter + R_counter\n",
335
+ "prior_fin = math.log2(F_counter/total_classes)\n",
336
+ "prior_riv = math.log2(R_counter/total_classes)\n",
337
+ "\n",
338
+ "prior_fin, prior_riv"
339
+ ]
340
+ },
341
+ {
342
+ "cell_type": "code",
343
+ "execution_count": 61,
344
+ "metadata": {},
345
+ "outputs": [
346
+ {
347
+ "data": {
348
+ "text/plain": [
349
+ "255"
350
+ ]
351
+ },
352
+ "execution_count": 61,
353
+ "metadata": {},
354
+ "output_type": "execute_result"
355
+ }
356
+ ],
357
+ "source": [
358
+ "Vocab = set(list(F_freq.keys()) + list(R_freq.keys()))\n",
359
+ "V = len(Vocab)\n",
360
+ "V"
361
+ ]
362
+ },
363
+ {
364
+ "cell_type": "markdown",
365
+ "metadata": {},
366
+ "source": [
367
+ "## Test"
368
+ ]
369
+ },
370
+ {
371
+ "cell_type": "code",
372
+ "execution_count": 64,
373
+ "metadata": {},
374
+ "outputs": [
375
+ {
376
+ "data": {
377
+ "text/html": [
378
+ "<div>\n",
379
+ "<style scoped>\n",
380
+ " .dataframe tbody tr th:only-of-type {\n",
381
+ " vertical-align: middle;\n",
382
+ " }\n",
383
+ "\n",
384
+ " .dataframe tbody tr th {\n",
385
+ " vertical-align: top;\n",
386
+ " }\n",
387
+ "\n",
388
+ " .dataframe thead th {\n",
389
+ " text-align: right;\n",
390
+ " }\n",
391
+ "</style>\n",
392
+ "<table border=\"1\" class=\"dataframe\">\n",
393
+ " <thead>\n",
394
+ " <tr style=\"text-align: right;\">\n",
395
+ " <th></th>\n",
396
+ " <th>Sentence</th>\n",
397
+ " <th>Class</th>\n",
398
+ " </tr>\n",
399
+ " </thead>\n",
400
+ " <tbody>\n",
401
+ " <tr>\n",
402
+ " <th>95</th>\n",
403
+ " <td>I need to update my contact information with t...</td>\n",
404
+ " <td>?</td>\n",
405
+ " </tr>\n",
406
+ " <tr>\n",
407
+ " <th>96</th>\n",
408
+ " <td>The bank provides online banking services for ...</td>\n",
409
+ " <td>?</td>\n",
410
+ " </tr>\n",
411
+ " <tr>\n",
412
+ " <th>97</th>\n",
413
+ " <td>The beavers constructed a dam along the bank o...</td>\n",
414
+ " <td>?</td>\n",
415
+ " </tr>\n",
416
+ " <tr>\n",
417
+ " <th>98</th>\n",
418
+ " <td>I need to check my transaction history at the ...</td>\n",
419
+ " <td>?</td>\n",
420
+ " </tr>\n",
421
+ " <tr>\n",
422
+ " <th>99</th>\n",
423
+ " <td>She works as a financial consultant at the bank.</td>\n",
424
+ " <td>?</td>\n",
425
+ " </tr>\n",
426
+ " </tbody>\n",
427
+ "</table>\n",
428
+ "</div>"
429
+ ],
430
+ "text/plain": [
431
+ " Sentence Class\n",
432
+ "95 I need to update my contact information with t... ?\n",
433
+ "96 The bank provides online banking services for ... ?\n",
434
+ "97 The beavers constructed a dam along the bank o... ?\n",
435
+ "98 I need to check my transaction history at the ... ?\n",
436
+ "99 She works as a financial consultant at the bank. ?"
437
+ ]
438
+ },
439
+ "execution_count": 64,
440
+ "metadata": {},
441
+ "output_type": "execute_result"
442
+ }
443
+ ],
444
+ "source": [
445
+ "df = pd.read_csv(\"../Bank.csv\")\n",
446
+ "test = df.iloc[95:, :]\n",
447
+ "test.head()"
448
+ ]
449
+ },
450
+ {
451
+ "cell_type": "code",
452
+ "execution_count": 67,
453
+ "metadata": {},
454
+ "outputs": [
455
+ {
456
+ "data": {
457
+ "text/html": [
458
+ "<div>\n",
459
+ "<style scoped>\n",
460
+ " .dataframe tbody tr th:only-of-type {\n",
461
+ " vertical-align: middle;\n",
462
+ " }\n",
463
+ "\n",
464
+ " .dataframe tbody tr th {\n",
465
+ " vertical-align: top;\n",
466
+ " }\n",
467
+ "\n",
468
+ " .dataframe thead th {\n",
469
+ " text-align: right;\n",
470
+ " }\n",
471
+ "</style>\n",
472
+ "<table border=\"1\" class=\"dataframe\">\n",
473
+ " <thead>\n",
474
+ " <tr style=\"text-align: right;\">\n",
475
+ " <th></th>\n",
476
+ " <th>Sentence</th>\n",
477
+ " <th>Class</th>\n",
478
+ " </tr>\n",
479
+ " </thead>\n",
480
+ " <tbody>\n",
481
+ " <tr>\n",
482
+ " <th>95</th>\n",
483
+ " <td>[need, update, contact, information, bank]</td>\n",
484
+ " <td>?</td>\n",
485
+ " </tr>\n",
486
+ " <tr>\n",
487
+ " <th>96</th>\n",
488
+ " <td>[bank, provides, online, banking, services, co...</td>\n",
489
+ " <td>?</td>\n",
490
+ " </tr>\n",
491
+ " <tr>\n",
492
+ " <th>97</th>\n",
493
+ " <td>[beavers, constructed, dam, along, bank, river]</td>\n",
494
+ " <td>?</td>\n",
495
+ " </tr>\n",
496
+ " <tr>\n",
497
+ " <th>98</th>\n",
498
+ " <td>[need, check, transaction, history, bank]</td>\n",
499
+ " <td>?</td>\n",
500
+ " </tr>\n",
501
+ " <tr>\n",
502
+ " <th>99</th>\n",
503
+ " <td>[works, financial, consultant, bank]</td>\n",
504
+ " <td>?</td>\n",
505
+ " </tr>\n",
506
+ " </tbody>\n",
507
+ "</table>\n",
508
+ "</div>"
509
+ ],
510
+ "text/plain": [
511
+ " Sentence Class\n",
512
+ "95 [need, update, contact, information, bank] ?\n",
513
+ "96 [bank, provides, online, banking, services, co... ?\n",
514
+ "97 [beavers, constructed, dam, along, bank, river] ?\n",
515
+ "98 [need, check, transaction, history, bank] ?\n",
516
+ "99 [works, financial, consultant, bank] ?"
517
+ ]
518
+ },
519
+ "execution_count": 67,
520
+ "metadata": {},
521
+ "output_type": "execute_result"
522
+ }
523
+ ],
524
+ "source": [
525
+ "for _,row in test.iterrows():\n",
526
+ " row[\"Sentence\"] = row[\"Sentence\"].lower()\n",
527
+ " row[\"Sentence\"] = word_tokenize(row[\"Sentence\"])\n",
528
+ " row[\"Sentence\"] = [i for i in row[\"Sentence\"] if i not in stops and i not in string.punctuation]\n",
529
+ "test.head()"
530
+ ]
531
+ },
532
+ {
533
+ "cell_type": "code",
534
+ "execution_count": 78,
535
+ "metadata": {},
536
+ "outputs": [
537
+ {
538
+ "data": {
539
+ "text/html": [
540
+ "<div>\n",
541
+ "<style scoped>\n",
542
+ " .dataframe tbody tr th:only-of-type {\n",
543
+ " vertical-align: middle;\n",
544
+ " }\n",
545
+ "\n",
546
+ " .dataframe tbody tr th {\n",
547
+ " vertical-align: top;\n",
548
+ " }\n",
549
+ "\n",
550
+ " .dataframe thead th {\n",
551
+ " text-align: right;\n",
552
+ " }\n",
553
+ "</style>\n",
554
+ "<table border=\"1\" class=\"dataframe\">\n",
555
+ " <thead>\n",
556
+ " <tr style=\"text-align: right;\">\n",
557
+ " <th></th>\n",
558
+ " <th>Sentence</th>\n",
559
+ " <th>Class</th>\n",
560
+ " </tr>\n",
561
+ " </thead>\n",
562
+ " <tbody>\n",
563
+ " <tr>\n",
564
+ " <th>95</th>\n",
565
+ " <td>[need, update, contact, information, bank]</td>\n",
566
+ " <td>Financial Institution</td>\n",
567
+ " </tr>\n",
568
+ " <tr>\n",
569
+ " <th>96</th>\n",
570
+ " <td>[bank, provides, online, banking, services, co...</td>\n",
571
+ " <td>Financial Institution</td>\n",
572
+ " </tr>\n",
573
+ " <tr>\n",
574
+ " <th>97</th>\n",
575
+ " <td>[beavers, constructed, dam, along, bank, river]</td>\n",
576
+ " <td>Financial Institution</td>\n",
577
+ " </tr>\n",
578
+ " <tr>\n",
579
+ " <th>98</th>\n",
580
+ " <td>[need, check, transaction, history, bank]</td>\n",
581
+ " <td>Financial Institution</td>\n",
582
+ " </tr>\n",
583
+ " <tr>\n",
584
+ " <th>99</th>\n",
585
+ " <td>[works, financial, consultant, bank]</td>\n",
586
+ " <td>Financial Institution</td>\n",
587
+ " </tr>\n",
588
+ " </tbody>\n",
589
+ "</table>\n",
590
+ "</div>"
591
+ ],
592
+ "text/plain": [
593
+ " Sentence Class\n",
594
+ "95 [need, update, contact, information, bank] Financial Institution\n",
595
+ "96 [bank, provides, online, banking, services, co... Financial Institution\n",
596
+ "97 [beavers, constructed, dam, along, bank, river] Financial Institution\n",
597
+ "98 [need, check, transaction, history, bank] Financial Institution\n",
598
+ "99 [works, financial, consultant, bank] Financial Institution"
599
+ ]
600
+ },
601
+ "execution_count": 78,
602
+ "metadata": {},
603
+ "output_type": "execute_result"
604
+ }
605
+ ],
606
+ "source": [
607
+ "for _, row in test.iterrows():\n",
608
+ " score_fin = prior_fin\n",
609
+ " score_riv = prior_riv\n",
610
+ "\n",
611
+ " for token in row[\"Sentence\"]:\n",
612
+ " score_fin += math.log2(F_freq[token] + 1) - math.log2(F_counter + V)\n",
613
+ " score_riv += math.log2(R_freq[token] + 1) - math.log2(R_counter + V)\n",
614
+ "\n",
615
+ " if score_fin > score_riv:\n",
616
+ " row[\"Class\"] = \"Financial Institution\"\n",
617
+ " else:\n",
618
+ " row[\"Class\"] = \"River Border\"\n",
619
+ "\n",
620
+ "test"
621
+ ]
622
+ }
623
+ ],
624
+ "metadata": {
625
+ "kernelspec": {
626
+ "display_name": "Python 3",
627
+ "language": "python",
628
+ "name": "python3"
629
+ },
630
+ "language_info": {
631
+ "codemirror_mode": {
632
+ "name": "ipython",
633
+ "version": 3
634
+ },
635
+ "file_extension": ".py",
636
+ "mimetype": "text/x-python",
637
+ "name": "python",
638
+ "nbconvert_exporter": "python",
639
+ "pygments_lexer": "ipython3",
640
+ "version": "3.12.7"
641
+ }
642
+ },
643
+ "nbformat": 4,
644
+ "nbformat_minor": 2
645
+ }