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,216 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 5,
6
+ "id": "b443a5d0-8fca-4594-948b-b0882a4d47cb",
7
+ "metadata": {},
8
+ "outputs": [
9
+ {
10
+ "name": "stdout",
11
+ "output_type": "stream",
12
+ "text": [
13
+ "The preposition 'with' attaches to the 'VP'\n"
14
+ ]
15
+ }
16
+ ],
17
+ "source": [
18
+ "from collections import defaultdict\n",
19
+ "\n",
20
+ "class HindleRoothPPAttachment:\n",
21
+ " def __init__(self):\n",
22
+ " # Dictionary to store co-occurrence counts\n",
23
+ " self.np_p_counts = defaultdict(int)\n",
24
+ " self.vp_p_counts = defaultdict(int)\n",
25
+ " self.p_counts = defaultdict(int)\n",
26
+ " \n",
27
+ " def train(self, corpus):\n",
28
+ " \"\"\"\n",
29
+ " Train the model using a parsed corpus.\n",
30
+ " \n",
31
+ " :param corpus: A parsed corpus with tuples (NP, VP, P)\n",
32
+ " \"\"\"\n",
33
+ " for (np, vp, p) in corpus:\n",
34
+ " self.np_p_counts[(np, p)] += 1\n",
35
+ " self.vp_p_counts[(vp, p)] += 1\n",
36
+ " self.p_counts[p] += 1\n",
37
+ " \n",
38
+ " def calculate_probabilities(self, np, vp, p):\n",
39
+ " \"\"\"\n",
40
+ " Calculate the probabilities P(NP, P) and P(VP, P).\n",
41
+ " \n",
42
+ " :param np: Noun phrase\n",
43
+ " :param vp: Verb phrase\n",
44
+ " :param p: Preposition\n",
45
+ " :return: (P(NP, P), P(VP, P))\n",
46
+ " \"\"\"\n",
47
+ " p_count = self.p_counts[p]\n",
48
+ " \n",
49
+ " # Avoid division by zero\n",
50
+ " if p_count == 0:\n",
51
+ " return 0, 0\n",
52
+ " \n",
53
+ " p_np_p = self.np_p_counts[(np, p)] / p_count\n",
54
+ " p_vp_p = self.vp_p_counts[(vp, p)] / p_count\n",
55
+ " \n",
56
+ " return p_np_p, p_vp_p\n",
57
+ " \n",
58
+ " def decide_attachment(self, np, vp, p):\n",
59
+ " \"\"\"\n",
60
+ " Decide whether the preposition attaches to the NP or the VP.\n",
61
+ " \n",
62
+ " :param np: Noun phrase\n",
63
+ " :param vp: Verb phrase\n",
64
+ " :param p: Preposition\n",
65
+ " :return: 'NP' or 'VP' based on the attachment decision\n",
66
+ " \"\"\"\n",
67
+ " p_np_p, p_vp_p = self.calculate_probabilities(np, vp, p)\n",
68
+ " \n",
69
+ " if p_np_p > p_vp_p:\n",
70
+ " return 'NP'\n",
71
+ " else:\n",
72
+ " return 'VP'\n",
73
+ "\n",
74
+ "# Example usage\n",
75
+ "if __name__ == \"__main__\":\n",
76
+ " # Example corpus: List of tuples (NP, VP, P)\n",
77
+ " corpus = [\n",
78
+ " (\"the man\", \"saw\", \"with\"),\n",
79
+ " (\"the book\", \"is\", \"on\"),\n",
80
+ " (\"the cat\", \"sat\", \"on\"),\n",
81
+ " (\"the dog\", \"barked\", \"at\"),\n",
82
+ " # More parsed sentences from a corpus...\n",
83
+ " ]\n",
84
+ " \n",
85
+ " hr_model = HindleRoothPPAttachment()\n",
86
+ " hr_model.train(corpus)\n",
87
+ " \n",
88
+ " # Test the model with a new sentence\n",
89
+ " np = \"soldiers\"\n",
90
+ " vp = \"saw\"\n",
91
+ " p = \"with\"\n",
92
+ " \n",
93
+ " attachment = hr_model.decide_attachment(np, vp, p)\n",
94
+ " print(f\"The preposition '{p}' attaches to the '{attachment}'\")"
95
+ ]
96
+ },
97
+ {
98
+ "cell_type": "code",
99
+ "execution_count": 12,
100
+ "id": "47e7d4c7-1352-47a9-8625-270b1bacdc48",
101
+ "metadata": {},
102
+ "outputs": [
103
+ {
104
+ "name": "stdin",
105
+ "output_type": "stream",
106
+ "text": [
107
+ "Enter the verb: 1\n",
108
+ "Enter the noun: 2\n",
109
+ "Enter the preposition: 3\n",
110
+ "Enter the occurrence of the preposition '3' with the verb '1': 4\n",
111
+ "Enter the total occurrences of the verb '1': 5\n",
112
+ "Enter the occurrence of the preposition '3' with the noun '2': 6\n",
113
+ "Enter the total occurrences of the noun '2': 7\n"
114
+ ]
115
+ },
116
+ {
117
+ "name": "stdout",
118
+ "output_type": "stream",
119
+ "text": [
120
+ "Lambda :(1, 2, 3) = -2.906890595608518\n",
121
+ "PP attaches with the Noun.\n"
122
+ ]
123
+ }
124
+ ],
125
+ "source": [
126
+ "import math\n",
127
+ "\n",
128
+ "# Step 1: Ask the user for occurrence counts\n",
129
+ "def get_user_input():\n",
130
+ " verb = input(\"Enter the verb: \").strip()\n",
131
+ " noun = input(\"Enter the noun: \").strip()\n",
132
+ " prep = input(\"Enter the preposition: \").strip()\n",
133
+ " \n",
134
+ " verb_prep_count = int(input(f\"Enter the occurrence of the preposition '{prep}' with the verb '{verb}': \"))\n",
135
+ " verb_total_count = int(input(f\"Enter the total occurrences of the verb '{verb}': \"))\n",
136
+ " \n",
137
+ " noun_prep_count = int(input(f\"Enter the occurrence of the preposition '{prep}' with the noun '{noun}': \"))\n",
138
+ " noun_total_count = int(input(f\"Enter the total occurrences of the noun '{noun}': \"))\n",
139
+ "\n",
140
+ " return verb, noun, prep, verb_prep_count, verb_total_count, noun_prep_count, noun_total_count\n",
141
+ "\n",
142
+ "# Step 2: Calculate Probabilities and λ(v, n, p)\n",
143
+ "def calculate_lambda(verb, noun, prep, verb_prep_count, verb_total_count, noun_prep_count, noun_total_count):\n",
144
+ " # Calculate P(VA_p = 1 | v)\n",
145
+ " P_VAp = verb_prep_count / verb_total_count\n",
146
+ " \n",
147
+ " # Calculate P(NA_p = 1 | n)\n",
148
+ " P_NAp = noun_prep_count / noun_total_count\n",
149
+ " \n",
150
+ " # Calculate P(NA_p = 0 | n)\n",
151
+ " P_NAp_0 = 1 - P_NAp\n",
152
+ "\n",
153
+ " # Handle case where probabilities might cause division by zero\n",
154
+ " if P_NAp == 0:\n",
155
+ " return None, \"Error: Division by zero in log-ratio calculation due to insufficient data.\"\n",
156
+ " \n",
157
+ " # Calculate λ(v, n, p)\n",
158
+ " lambda_value = math.log2((P_VAp * P_NAp_0) / P_NAp)\n",
159
+ " \n",
160
+ " return lambda_value, None\n",
161
+ "\n",
162
+ "# Step 3: Determine the attachment\n",
163
+ "def determine_attachment(lambda_value):\n",
164
+ " if lambda_value > 0:\n",
165
+ " return \"PP attaches with the Verb.\"\n",
166
+ " else:\n",
167
+ " return \"PP attaches with the Noun.\"\n",
168
+ "\n",
169
+ "# Step 4: Interactive User Input\n",
170
+ "def hindle_rooth_algorithm():\n",
171
+ " verb, noun, prep, verb_prep_count, verb_total_count, noun_prep_count, noun_total_count = get_user_input()\n",
172
+ "\n",
173
+ " lambda_value, error_message = calculate_lambda(verb, noun, prep, verb_prep_count, verb_total_count, noun_prep_count, noun_total_count)\n",
174
+ " \n",
175
+ " if error_message:\n",
176
+ " print(error_message)\n",
177
+ " else:\n",
178
+ " result = determine_attachment(lambda_value)\n",
179
+ " print(f\"Lambda :({verb}, {noun}, {prep}) = {lambda_value}\")\n",
180
+ " print(result)\n",
181
+ "\n",
182
+ "# Run the interactive algorithm\n",
183
+ "hindle_rooth_algorithm()"
184
+ ]
185
+ },
186
+ {
187
+ "cell_type": "code",
188
+ "execution_count": null,
189
+ "id": "0cc09162-7ca1-431b-bc2f-923fd94904a5",
190
+ "metadata": {},
191
+ "outputs": [],
192
+ "source": []
193
+ }
194
+ ],
195
+ "metadata": {
196
+ "kernelspec": {
197
+ "display_name": "Python 3 (ipykernel)",
198
+ "language": "python",
199
+ "name": "python3"
200
+ },
201
+ "language_info": {
202
+ "codemirror_mode": {
203
+ "name": "ipython",
204
+ "version": 3
205
+ },
206
+ "file_extension": ".py",
207
+ "mimetype": "text/x-python",
208
+ "name": "python",
209
+ "nbconvert_exporter": "python",
210
+ "pygments_lexer": "ipython3",
211
+ "version": "3.11.7"
212
+ }
213
+ },
214
+ "nbformat": 4,
215
+ "nbformat_minor": 5
216
+ }
@@ -0,0 +1,216 @@
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "code",
5
+ "execution_count": 1,
6
+ "id": "b443a5d0-8fca-4594-948b-b0882a4d47cb",
7
+ "metadata": {},
8
+ "outputs": [
9
+ {
10
+ "name": "stdout",
11
+ "output_type": "stream",
12
+ "text": [
13
+ "The preposition 'with' attaches to the 'VP'\n"
14
+ ]
15
+ }
16
+ ],
17
+ "source": [
18
+ "from collections import defaultdict\n",
19
+ "\n",
20
+ "class HindleRoothPPAttachment:\n",
21
+ " def __init__(self):\n",
22
+ " # Dictionary to store co-occurrence counts\n",
23
+ " self.np_p_counts = defaultdict(int)\n",
24
+ " self.vp_p_counts = defaultdict(int)\n",
25
+ " self.p_counts = defaultdict(int)\n",
26
+ " \n",
27
+ " def train(self, corpus):\n",
28
+ " \"\"\"\n",
29
+ " Train the model using a parsed corpus.\n",
30
+ " \n",
31
+ " :param corpus: A parsed corpus with tuples (NP, VP, P)\n",
32
+ " \"\"\"\n",
33
+ " for (np, vp, p) in corpus:\n",
34
+ " self.np_p_counts[(np, p)] += 1\n",
35
+ " self.vp_p_counts[(vp, p)] += 1\n",
36
+ " self.p_counts[p] += 1\n",
37
+ " \n",
38
+ " def calculate_probabilities(self, np, vp, p):\n",
39
+ " \"\"\"\n",
40
+ " Calculate the probabilities P(NP, P) and P(VP, P).\n",
41
+ " \n",
42
+ " :param np: Noun phrase\n",
43
+ " :param vp: Verb phrase\n",
44
+ " :param p: Preposition\n",
45
+ " :return: (P(NP, P), P(VP, P))\n",
46
+ " \"\"\"\n",
47
+ " p_count = self.p_counts[p]\n",
48
+ " \n",
49
+ " # Avoid division by zero\n",
50
+ " if p_count == 0:\n",
51
+ " return 0, 0\n",
52
+ " \n",
53
+ " p_np_p = self.np_p_counts[(np, p)] / p_count\n",
54
+ " p_vp_p = self.vp_p_counts[(vp, p)] / p_count\n",
55
+ " \n",
56
+ " return p_np_p, p_vp_p\n",
57
+ " \n",
58
+ " def decide_attachment(self, np, vp, p):\n",
59
+ " \"\"\"\n",
60
+ " Decide whether the preposition attaches to the NP or the VP.\n",
61
+ " \n",
62
+ " :param np: Noun phrase\n",
63
+ " :param vp: Verb phrase\n",
64
+ " :param p: Preposition\n",
65
+ " :return: 'NP' or 'VP' based on the attachment decision\n",
66
+ " \"\"\"\n",
67
+ " p_np_p, p_vp_p = self.calculate_probabilities(np, vp, p)\n",
68
+ " \n",
69
+ " if p_np_p > p_vp_p:\n",
70
+ " return 'NP'\n",
71
+ " else:\n",
72
+ " return 'VP'\n",
73
+ "\n",
74
+ "# Example usage\n",
75
+ "if __name__ == \"__main__\":\n",
76
+ " # Example corpus: List of tuples (NP, VP, P)\n",
77
+ " corpus = [\n",
78
+ " (\"the man\", \"saw\", \"with\"),\n",
79
+ " (\"the book\", \"is\", \"on\"),\n",
80
+ " (\"the cat\", \"sat\", \"on\"),\n",
81
+ " (\"the dog\", \"barked\", \"at\"),\n",
82
+ " # More parsed sentences from a corpus...\n",
83
+ " ]\n",
84
+ " \n",
85
+ " hr_model = HindleRoothPPAttachment()\n",
86
+ " hr_model.train(corpus)\n",
87
+ " \n",
88
+ " # Test the model with a new sentence\n",
89
+ " np = \"the man\"\n",
90
+ " vp = \"saw\"\n",
91
+ " p = \"with\"\n",
92
+ " \n",
93
+ " attachment = hr_model.decide_attachment(np, vp, p)\n",
94
+ " print(f\"The preposition '{p}' attaches to the '{attachment}'\")"
95
+ ]
96
+ },
97
+ {
98
+ "cell_type": "code",
99
+ "execution_count": 3,
100
+ "id": "47e7d4c7-1352-47a9-8625-270b1bacdc48",
101
+ "metadata": {},
102
+ "outputs": [
103
+ {
104
+ "name": "stdin",
105
+ "output_type": "stream",
106
+ "text": [
107
+ "Enter the verb: send\n",
108
+ "Enter the noun: soldiers\n",
109
+ "Enter the preposition: into\n",
110
+ "Enter the occurrence of the preposition 'into' with the verb 'send': 86\n",
111
+ "Enter the total occurrences of the verb 'send': 1742\n",
112
+ "Enter the occurrence of the preposition 'into' with the noun 'soldiers': 1\n",
113
+ "Enter the total occurrences of the noun 'soldiers': 1478\n"
114
+ ]
115
+ },
116
+ {
117
+ "name": "stdout",
118
+ "output_type": "stream",
119
+ "text": [
120
+ "λ(send, soldiers, into) = 6.1881899568680225\n",
121
+ "PP attaches with the Verb.\n"
122
+ ]
123
+ }
124
+ ],
125
+ "source": [
126
+ "import math\n",
127
+ "\n",
128
+ "# Step 1: Ask the user for occurrence counts\n",
129
+ "def get_user_input():\n",
130
+ " verb = input(\"Enter the verb: \").strip()\n",
131
+ " noun = input(\"Enter the noun: \").strip()\n",
132
+ " prep = input(\"Enter the preposition: \").strip()\n",
133
+ " \n",
134
+ " verb_prep_count = int(input(f\"Enter the occurrence of the preposition '{prep}' with the verb '{verb}': \"))\n",
135
+ " verb_total_count = int(input(f\"Enter the total occurrences of the verb '{verb}': \"))\n",
136
+ " \n",
137
+ " noun_prep_count = int(input(f\"Enter the occurrence of the preposition '{prep}' with the noun '{noun}': \"))\n",
138
+ " noun_total_count = int(input(f\"Enter the total occurrences of the noun '{noun}': \"))\n",
139
+ "\n",
140
+ " return verb, noun, prep, verb_prep_count, verb_total_count, noun_prep_count, noun_total_count\n",
141
+ "\n",
142
+ "# Step 2: Calculate Probabilities and λ(v, n, p)\n",
143
+ "def calculate_lambda(verb, noun, prep, verb_prep_count, verb_total_count, noun_prep_count, noun_total_count):\n",
144
+ " # Calculate P(VA_p = 1 | v)\n",
145
+ " P_VAp = verb_prep_count / verb_total_count\n",
146
+ " \n",
147
+ " # Calculate P(NA_p = 1 | n)\n",
148
+ " P_NAp = noun_prep_count / noun_total_count\n",
149
+ " \n",
150
+ " # Calculate P(NA_p = 0 | n)\n",
151
+ " P_NAp_0 = 1 - P_NAp\n",
152
+ "\n",
153
+ " # Handle case where probabilities might cause division by zero\n",
154
+ " if P_NAp == 0:\n",
155
+ " return None, \"Error: Division by zero in log-ratio calculation due to insufficient data.\"\n",
156
+ " \n",
157
+ " # Calculate λ(v, n, p)\n",
158
+ " lambda_value = math.log2((P_VAp * P_NAp_0) / P_NAp)\n",
159
+ " \n",
160
+ " return lambda_value, None\n",
161
+ "\n",
162
+ "# Step 3: Determine the attachment\n",
163
+ "def determine_attachment(lambda_value):\n",
164
+ " if lambda_value > 0:\n",
165
+ " return \"PP attaches with the Verb.\"\n",
166
+ " else:\n",
167
+ " return \"PP attaches with the Noun.\"\n",
168
+ "\n",
169
+ "# Step 4: Interactive User Input\n",
170
+ "def hindle_rooth_algorithm():\n",
171
+ " verb, noun, prep, verb_prep_count, verb_total_count, noun_prep_count, noun_total_count = get_user_input()\n",
172
+ "\n",
173
+ " lambda_value, error_message = calculate_lambda(verb, noun, prep, verb_prep_count, verb_total_count, noun_prep_count, noun_total_count)\n",
174
+ " \n",
175
+ " if error_message:\n",
176
+ " print(error_message)\n",
177
+ " else:\n",
178
+ " result = determine_attachment(lambda_value)\n",
179
+ " print(f\"λ({verb}, {noun}, {prep}) = {lambda_value}\")\n",
180
+ " print(result)\n",
181
+ "\n",
182
+ "# Run the interactive algorithm\n",
183
+ "hindle_rooth_algorithm()"
184
+ ]
185
+ },
186
+ {
187
+ "cell_type": "code",
188
+ "execution_count": null,
189
+ "id": "0cc09162-7ca1-431b-bc2f-923fd94904a5",
190
+ "metadata": {},
191
+ "outputs": [],
192
+ "source": []
193
+ }
194
+ ],
195
+ "metadata": {
196
+ "kernelspec": {
197
+ "display_name": "Python 3 (ipykernel)",
198
+ "language": "python",
199
+ "name": "python3"
200
+ },
201
+ "language_info": {
202
+ "codemirror_mode": {
203
+ "name": "ipython",
204
+ "version": 3
205
+ },
206
+ "file_extension": ".py",
207
+ "mimetype": "text/x-python",
208
+ "name": "python",
209
+ "nbconvert_exporter": "python",
210
+ "pygments_lexer": "ipython3",
211
+ "version": "3.11.7"
212
+ }
213
+ },
214
+ "nbformat": 4,
215
+ "nbformat_minor": 5
216
+ }
@@ -0,0 +1,6 @@
1
+ Guy: How old are you?
2
+ Hipster girl: You know, I never answer that question. Because to me, it's about
3
+ how mature you are, you know? I mean, a fourteen year old could be more mature
4
+ than a twenty-five year old, right? I'm sorry, I just never answer that question.
5
+ Guy: But, uh, you're older than eighteen, right?
6
+ Hipster girl: Oh, yeah.