noshot 0.1.6__py3-none-any.whl → 0.1.8__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 (228) hide show
  1. noshot/data/ML TS XAI/ML/1. PCA - EDA/PCA-EDA.ipynb +207 -0
  2. noshot/data/ML TS XAI/ML/1. PCA - EDA/balance-scale.csv +626 -0
  3. noshot/data/ML TS XAI/ML/1. PCA - EDA/input.txt +625 -0
  4. noshot/data/ML TS XAI/ML/2. KNN Classifier/KNN.ipynb +287 -0
  5. noshot/data/ML TS XAI/ML/2. KNN Classifier/balance-scale.csv +626 -0
  6. noshot/data/ML TS XAI/ML/2. KNN Classifier/input.txt +625 -0
  7. noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/LDA.ipynb +83 -0
  8. noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/balance-scale.csv +626 -0
  9. noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/input.txt +625 -0
  10. noshot/data/ML TS XAI/ML/4. Linear Regression/Linear-Regression.ipynb +117 -0
  11. noshot/data/ML TS XAI/ML/4. Linear Regression/machine-data.csv +210 -0
  12. noshot/data/ML TS XAI/ML/5. Logistic Regression/Logistic-Regression.ipynb +137 -0
  13. noshot/data/ML TS XAI/ML/5. Logistic Regression/wine-dataset.csv +179 -0
  14. noshot/data/ML TS XAI/ML/6. Bayesian Classifier/Bayesian.ipynb +129 -0
  15. noshot/data/ML TS XAI/ML/6. Bayesian Classifier/wine-dataset.csv +179 -0
  16. {noshot-0.1.6.dist-info → noshot-0.1.8.dist-info}/METADATA +2 -2
  17. noshot-0.1.8.dist-info/RECORD +24 -0
  18. noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(A) Breadth First Search.ipynb +0 -112
  19. noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(B) Depth First Search.ipynb +0 -111
  20. noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(C) Uniform Cost Search.ipynb +0 -134
  21. noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(D) Depth Limites Search.ipynb +0 -115
  22. noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(E) Iterative Deepening DFS.ipynb +0 -123
  23. noshot/data/ML TS XAI/AIDS/10. ANOVA/2_ANOVA.csv +0 -769
  24. noshot/data/ML TS XAI/AIDS/10. ANOVA/One Way ANOVA (Repeated Measure).ipynb +0 -126
  25. noshot/data/ML TS XAI/AIDS/10. ANOVA/One Way ANOVA.ipynb +0 -134
  26. noshot/data/ML TS XAI/AIDS/10. ANOVA/Sample 1 Way ANOVA Test.ipynb +0 -119
  27. noshot/data/ML TS XAI/AIDS/10. ANOVA/Two Way ANOVA.ipynb +0 -138
  28. noshot/data/ML TS XAI/AIDS/10. ANOVA/reaction_time.csv +0 -5
  29. noshot/data/ML TS XAI/AIDS/10. ANOVA/sample_data.csv +0 -16
  30. noshot/data/ML TS XAI/AIDS/10. ANOVA/sleep_deprivation.csv +0 -4
  31. noshot/data/ML TS XAI/AIDS/11. Linear Regression/3_Linear.csv +0 -4802
  32. noshot/data/ML TS XAI/AIDS/11. Linear Regression/Linear Regression LAB.ipynb +0 -113
  33. noshot/data/ML TS XAI/AIDS/11. Linear Regression/Linear Regression New- sklearn.ipynb +0 -118
  34. noshot/data/ML TS XAI/AIDS/11. Linear Regression/Linear Regression.ipynb +0 -148
  35. noshot/data/ML TS XAI/AIDS/11. Linear Regression/house_rate.csv +0 -22
  36. noshot/data/ML TS XAI/AIDS/12. Logistic Regression/Logistic Regression New- sklearn.ipynb +0 -128
  37. noshot/data/ML TS XAI/AIDS/12. Logistic Regression/Logistic Regression.ipynb +0 -145
  38. noshot/data/ML TS XAI/AIDS/12. Logistic Regression/default.csv +0 -1001
  39. noshot/data/ML TS XAI/AIDS/12. Logistic Regression/hours_scores_records.csv +0 -101
  40. noshot/data/ML TS XAI/AIDS/2. Implement A Star And MA Star/(A) Astar.ipynb +0 -256
  41. noshot/data/ML TS XAI/AIDS/2. Implement A Star And MA Star/(B) IDAstar.ipynb +0 -157
  42. noshot/data/ML TS XAI/AIDS/2. Implement A Star And MA Star/(C) SMAstar.ipynb +0 -178
  43. noshot/data/ML TS XAI/AIDS/3. Genetic Algorithm/Genetic.ipynb +0 -95
  44. noshot/data/ML TS XAI/AIDS/4. Simulated Annealing/Simulated Annealing.ipynb +0 -74
  45. noshot/data/ML TS XAI/AIDS/4. Simulated Annealing/Sudoku Simulated Annealing.ipynb +0 -103
  46. noshot/data/ML TS XAI/AIDS/5. Alpha Beta Pruning/AlphaBetaPruning.ipynb +0 -182
  47. noshot/data/ML TS XAI/AIDS/6. Consraint Satisfaction Problems (CSP)/(A) CSP House Allocation.ipynb +0 -120
  48. noshot/data/ML TS XAI/AIDS/6. Consraint Satisfaction Problems (CSP)/(B) CSP Map Coloring.ipynb +0 -125
  49. noshot/data/ML TS XAI/AIDS/7. Random Sampling/Random Sampling.ipynb +0 -73
  50. noshot/data/ML TS XAI/AIDS/7. Random Sampling/height_weight_bmi.csv +0 -8389
  51. noshot/data/ML TS XAI/AIDS/8. Z Test/Z Test Hash Function.ipynb +0 -141
  52. noshot/data/ML TS XAI/AIDS/8. Z Test/Z Test.ipynb +0 -151
  53. noshot/data/ML TS XAI/AIDS/8. Z Test/height_weight_bmi.csv +0 -8389
  54. noshot/data/ML TS XAI/AIDS/9. T Test/1_heart.csv +0 -304
  55. noshot/data/ML TS XAI/AIDS/9. T Test/Independent T Test.ipynb +0 -119
  56. noshot/data/ML TS XAI/AIDS/9. T Test/Paired T Test.ipynb +0 -118
  57. noshot/data/ML TS XAI/AIDS/9. T Test/T Test Hash Function.ipynb +0 -142
  58. noshot/data/ML TS XAI/AIDS/9. T Test/T Test.ipynb +0 -158
  59. noshot/data/ML TS XAI/AIDS/9. T Test/height_weight_bmi.csv +0 -8389
  60. noshot/data/ML TS XAI/AIDS/9. T Test/iq_test.csv +0 -0
  61. noshot/data/ML TS XAI/AIDS/Others (AllinOne)/All In One.ipynb +0 -4581
  62. noshot/data/ML TS XAI/CN/1. Chat Application/chat.java +0 -81
  63. noshot/data/ML TS XAI/CN/1. Chat Application/output.png +0 -0
  64. noshot/data/ML TS XAI/CN/1. Chat Application/procedure.png +0 -0
  65. noshot/data/ML TS XAI/CN/10. Ethernet LAN IEEE 802.3/LAN.tcl +0 -65
  66. noshot/data/ML TS XAI/CN/10. Ethernet LAN IEEE 802.3/analysis.awk +0 -44
  67. noshot/data/ML TS XAI/CN/10. Ethernet LAN IEEE 802.3/output.png +0 -0
  68. noshot/data/ML TS XAI/CN/10. Ethernet LAN IEEE 802.3/procedure.png +0 -0
  69. noshot/data/ML TS XAI/CN/11. Wireless LAN IEEE 802.11/complexdcf.tcl +0 -229
  70. noshot/data/ML TS XAI/CN/11. Wireless LAN IEEE 802.11/output.png +0 -0
  71. noshot/data/ML TS XAI/CN/11. Wireless LAN IEEE 802.11/procedure.png +0 -0
  72. noshot/data/ML TS XAI/CN/2. File Transfer/file_to_send.txt +0 -2
  73. noshot/data/ML TS XAI/CN/2. File Transfer/filetransfer.java +0 -119
  74. noshot/data/ML TS XAI/CN/2. File Transfer/output.png +0 -0
  75. noshot/data/ML TS XAI/CN/2. File Transfer/procedure.png +0 -0
  76. noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/Client.class +0 -0
  77. noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/MyServerImpl.class +0 -0
  78. noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/MyServerIntf.class +0 -0
  79. noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/Server.class +0 -0
  80. noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/output.png +0 -0
  81. noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/procedure.png +0 -0
  82. noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/rmi.java +0 -56
  83. noshot/data/ML TS XAI/CN/4. Wired Network/output.png +0 -0
  84. noshot/data/ML TS XAI/CN/4. Wired Network/procedure.png +0 -0
  85. noshot/data/ML TS XAI/CN/4. Wired Network/wired.awk +0 -25
  86. noshot/data/ML TS XAI/CN/4. Wired Network/wired.tcl +0 -81
  87. noshot/data/ML TS XAI/CN/5. Wireless Network/output.png +0 -0
  88. noshot/data/ML TS XAI/CN/5. Wireless Network/procedure.png +0 -0
  89. noshot/data/ML TS XAI/CN/5. Wireless Network/wireless.awk +0 -27
  90. noshot/data/ML TS XAI/CN/5. Wireless Network/wireless.tcl +0 -153
  91. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/analysis.awk +0 -27
  92. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/output.png +0 -0
  93. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/sack.tcl +0 -86
  94. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/vegas.tcl +0 -86
  95. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/analysis.awk +0 -28
  96. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/output.png +0 -0
  97. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/reno.tcl +0 -78
  98. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/tahoe.tcl +0 -79
  99. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Flow Control/analysis.awk +0 -27
  100. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Flow Control/flow.tcl +0 -163
  101. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Flow Control/output.png +0 -0
  102. noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/procedure.png +0 -0
  103. noshot/data/ML TS XAI/CN/7. Link State And Distance Vector Routing/DV.tcl +0 -111
  104. noshot/data/ML TS XAI/CN/7. Link State And Distance Vector Routing/LS.tcl +0 -106
  105. noshot/data/ML TS XAI/CN/7. Link State And Distance Vector Routing/analysis.awk +0 -36
  106. noshot/data/ML TS XAI/CN/7. Link State And Distance Vector Routing/output.png +0 -0
  107. noshot/data/ML TS XAI/CN/7. Link State And Distance Vector Routing/procedure.png +0 -0
  108. noshot/data/ML TS XAI/CN/8. Multicast And Broadcast Routing/analysis.awk +0 -20
  109. noshot/data/ML TS XAI/CN/8. Multicast And Broadcast Routing/broadcast.tcl +0 -76
  110. noshot/data/ML TS XAI/CN/8. Multicast And Broadcast Routing/multicast.tcl +0 -103
  111. noshot/data/ML TS XAI/CN/8. Multicast And Broadcast Routing/output.png +0 -0
  112. noshot/data/ML TS XAI/CN/8. Multicast And Broadcast Routing/procedure.png +0 -0
  113. noshot/data/ML TS XAI/CN/9. DHCP/DHCP.java +0 -125
  114. noshot/data/ML TS XAI/CN/9. DHCP/output.png +0 -0
  115. noshot/data/ML TS XAI/CN/9. DHCP/procedure.png +0 -0
  116. noshot/data/ML TS XAI/NLP/NLP 1/1-Prereqs.py +0 -18
  117. noshot/data/ML TS XAI/NLP/NLP 1/2-Chi2test.py +0 -83
  118. noshot/data/ML TS XAI/NLP/NLP 1/2-T-test.py +0 -79
  119. noshot/data/ML TS XAI/NLP/NLP 1/3-WSD-nb.py +0 -53
  120. noshot/data/ML TS XAI/NLP/NLP 1/4-Hindle-Rooth.py +0 -53
  121. noshot/data/ML TS XAI/NLP/NLP 1/5-HMM-Trellis.py +0 -82
  122. noshot/data/ML TS XAI/NLP/NLP 1/6-HMM-Viterbi.py +0 -16
  123. noshot/data/ML TS XAI/NLP/NLP 1/7-PCFG-parsetree.py +0 -15
  124. noshot/data/ML TS XAI/NLP/NLP 1/Chi2test.ipynb +0 -285
  125. noshot/data/ML TS XAI/NLP/NLP 1/Hindle-Rooth.ipynb +0 -179
  126. noshot/data/ML TS XAI/NLP/NLP 1/Lab 10 - Text generator using LSTM.ipynb +0 -1461
  127. noshot/data/ML TS XAI/NLP/NLP 1/Lab 11 NMT.ipynb +0 -2307
  128. noshot/data/ML TS XAI/NLP/NLP 1/PCFG.ipynb +0 -134
  129. noshot/data/ML TS XAI/NLP/NLP 1/Prereqs.ipynb +0 -131
  130. noshot/data/ML TS XAI/NLP/NLP 1/T test.ipynb +0 -252
  131. noshot/data/ML TS XAI/NLP/NLP 1/TFIDF BOW.ipynb +0 -171
  132. noshot/data/ML TS XAI/NLP/NLP 1/Trellis.ipynb +0 -244
  133. noshot/data/ML TS XAI/NLP/NLP 1/WSD.ipynb +0 -645
  134. noshot/data/ML TS XAI/NLP/NLP 1/Word2Vec.ipynb +0 -93
  135. noshot/data/ML TS XAI/NLP/NLP 2/Lab01(tokenizer)/tokenizer.ipynb +0 -370
  136. noshot/data/ML TS XAI/NLP/NLP 2/Lab01(tokenizer)/training_tokenizer.txt +0 -6
  137. noshot/data/ML TS XAI/NLP/NLP 2/Lab02(stemming)/exp0.ipynb +0 -274
  138. noshot/data/ML TS XAI/NLP/NLP 2/Lab02(stemming)/lab2.ipynb +0 -905
  139. noshot/data/ML TS XAI/NLP/NLP 2/Lab02(stemming)/test.txt +0 -1
  140. noshot/data/ML TS XAI/NLP/NLP 2/Lab02(stemming)/tokenizing.ipynb +0 -272
  141. noshot/data/ML TS XAI/NLP/NLP 2/Lab03(parse-tree)/collocation.ipynb +0 -332
  142. noshot/data/ML TS XAI/NLP/NLP 2/Lab03(parse-tree)/lab3.ipynb +0 -549
  143. noshot/data/ML TS XAI/NLP/NLP 2/Lab03(parse-tree)/nlp.txt +0 -1
  144. noshot/data/ML TS XAI/NLP/NLP 2/Lab04(collocation)/Lab4-NLP-Exp-2.ipynb +0 -817
  145. noshot/data/ML TS XAI/NLP/NLP 2/Lab04(collocation)/collocation.ipynb +0 -332
  146. noshot/data/ML TS XAI/NLP/NLP 2/Lab05(WSD)/NLP-Lab-5-Exp3.ipynb +0 -231
  147. noshot/data/ML TS XAI/NLP/NLP 2/Lab05(WSD)/word-sense-disambiguation.ipynb +0 -507
  148. noshot/data/ML TS XAI/NLP/NLP 2/Lab06(additional-exercise)/lab6.ipynb +0 -134
  149. noshot/data/ML TS XAI/NLP/NLP 2/Lab07(HMM,Viterbi)/NLP Exp 4.ipynb +0 -255
  150. noshot/data/ML TS XAI/NLP/NLP 2/Lab07(HMM,Viterbi)/NLP_Exp_5.ipynb +0 -159
  151. noshot/data/ML TS XAI/NLP/NLP 2/Lab08(PCFG)/PCFG.ipynb +0 -282
  152. noshot/data/ML TS XAI/NLP/NLP 2/Lab09-Hindle-rooth&MLP/Lab 9 - MLP classifier.ipynb +0 -670
  153. noshot/data/ML TS XAI/NLP/NLP 2/Lab09-Hindle-rooth&MLP/MLP-alternative-code.ipynb +0 -613
  154. noshot/data/ML TS XAI/NLP/NLP 2/Lab09-Hindle-rooth&MLP/hindle-rooth-algorithm.ipynb +0 -74
  155. noshot/data/ML TS XAI/NLP/NLP 2/Lab10(LSTM)/Lab_10_Text_generator_using_LSTM.ipynb +0 -480
  156. noshot/data/ML TS XAI/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/Machine-translation.ipynb +0 -445
  157. noshot/data/ML TS XAI/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/Viterbi-PCFG.ipynb +0 -105
  158. noshot/data/ML TS XAI/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/corpora_tools.py +0 -87
  159. noshot/data/ML TS XAI/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/data_utils.py +0 -11
  160. noshot/data/ML TS XAI/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/train_translator.py +0 -83
  161. noshot/data/ML TS XAI/NLP/NLP 2/Lab12(Information-Extraction)/Information_Extraction.ipynb +0 -201
  162. noshot/data/ML TS XAI/NLP/NLP 3/Backtrack-without-Verbitri.ipynb +0 -185
  163. noshot/data/ML TS XAI/NLP/NLP 3/Backward-Procedure.ipynb +0 -597
  164. noshot/data/ML TS XAI/NLP/NLP 3/Bag_of.ipynb +0 -1422
  165. noshot/data/ML TS XAI/NLP/NLP 3/CYK-algorithm.ipynb +0 -1067
  166. noshot/data/ML TS XAI/NLP/NLP 3/Forward-Procedure.ipynb +0 -477
  167. noshot/data/ML TS XAI/NLP/NLP 3/LSTM.ipynb +0 -1290
  168. noshot/data/ML TS XAI/NLP/NLP 3/Lab 10 - Text generator using LSTM.ipynb +0 -1461
  169. noshot/data/ML TS XAI/NLP/NLP 3/Lab 11 NMT.ipynb +0 -2307
  170. noshot/data/ML TS XAI/NLP/NLP 3/NLP-LAB-4.ipynb +0 -216
  171. noshot/data/ML TS XAI/NLP/NLP 3/NLP-LAB-5.ipynb +0 -216
  172. noshot/data/ML TS XAI/NLP/NLP 3/abc.txt +0 -6
  173. noshot/data/ML TS XAI/NLP/NLP 3/ex-1-nltk.ipynb +0 -711
  174. noshot/data/ML TS XAI/NLP/NLP 3/ex-2-nlp.ipynb +0 -267
  175. noshot/data/ML TS XAI/NLP/NLP 3/exp8&9.ipynb +0 -305
  176. noshot/data/ML TS XAI/NLP/NLP 3/hind.ipynb +0 -287
  177. noshot/data/ML TS XAI/NLP/NLP 3/lab66.ipynb +0 -752
  178. noshot/data/ML TS XAI/NLP/NLP 3/leb_3.ipynb +0 -612
  179. noshot/data/ML TS XAI/NLP/NLP 3/naive_bayes_classifier.pkl +0 -0
  180. noshot/data/ML TS XAI/NLP/NLP 3/nlp_leb_1.ipynb +0 -3008
  181. noshot/data/ML TS XAI/NLP/NLP 3/nlp_leb_2.ipynb +0 -3095
  182. noshot/data/ML TS XAI/NLP/NLP 3/nlplab-9.ipynb +0 -295
  183. noshot/data/ML TS XAI/NLP/NLP 3/nltk-ex-4.ipynb +0 -506
  184. noshot/data/ML TS XAI/NLP/NLP 3/text1.txt +0 -48
  185. noshot/data/ML TS XAI/NLP/NLP 3/text2.txt +0 -8
  186. noshot/data/ML TS XAI/NLP/NLP 3/text3.txt +0 -48
  187. noshot/data/ML TS XAI/NLP/NLP 3/translation-rnn.ipynb +0 -812
  188. noshot/data/ML TS XAI/NLP/NLP 3/word2vector.ipynb +0 -173
  189. noshot/data/ML TS XAI/NLP/NLP 4/Backward Procedure Algorithm.ipynb +0 -179
  190. noshot/data/ML TS XAI/NLP/NLP 4/Chi Square Collocation.ipynb +0 -208
  191. noshot/data/ML TS XAI/NLP/NLP 4/Collocation (T test).ipynb +0 -188
  192. noshot/data/ML TS XAI/NLP/NLP 4/Experiment 1.ipynb +0 -437
  193. noshot/data/ML TS XAI/NLP/NLP 4/Forward Procedure Algorithm.ipynb +0 -132
  194. noshot/data/ML TS XAI/NLP/NLP 4/Hindle Rooth.ipynb +0 -414
  195. noshot/data/ML TS XAI/NLP/NLP 4/MachineTranslation.ipynb +0 -368
  196. noshot/data/ML TS XAI/NLP/NLP 4/Multi Layer Perceptron using MLPClassifier.ipynb +0 -86
  197. noshot/data/ML TS XAI/NLP/NLP 4/Multi Layer Perceptron using Tensorflow.ipynb +0 -112
  198. noshot/data/ML TS XAI/NLP/NLP 4/PCFG Inside Probability.ipynb +0 -451
  199. noshot/data/ML TS XAI/NLP/NLP 4/Text Generation using LSTM.ipynb +0 -297
  200. noshot/data/ML TS XAI/NLP/NLP 4/Viterbi.ipynb +0 -310
  201. noshot/data/ML TS XAI/NLP/NLP 4/Word Sense Disambiguation.ipynb +0 -335
  202. noshot/data/ML TS XAI/NLP/NLP 5/10.Text Generation using LSTM.ipynb +0 -316
  203. noshot/data/ML TS XAI/NLP/NLP 5/11.Machine Translation.ipynb +0 -868
  204. noshot/data/ML TS XAI/NLP/NLP 5/2.T and Chi2 Test.ipynb +0 -204
  205. noshot/data/ML TS XAI/NLP/NLP 5/3.Word Sense Diambiguation.ipynb +0 -234
  206. noshot/data/ML TS XAI/NLP/NLP 5/4.Hinddle and Rooth.ipynb +0 -128
  207. noshot/data/ML TS XAI/NLP/NLP 5/5.Forward and Backward.ipynb +0 -149
  208. noshot/data/ML TS XAI/NLP/NLP 5/6.Viterbi.ipynb +0 -111
  209. noshot/data/ML TS XAI/NLP/NLP 5/7.PCFG Parse Tree.ipynb +0 -134
  210. noshot/data/ML TS XAI/NLP/NLP 5/7.PCFG using cyk.ipynb +0 -101
  211. noshot/data/ML TS XAI/NLP/NLP 5/8.Bag of words and TF-IDF.ipynb +0 -310
  212. noshot/data/ML TS XAI/NLP/NLP 5/9.Word2Vector.ipynb +0 -78
  213. noshot/data/ML TS XAI/NLP/NLP 5/NLP ALL In One.ipynb +0 -2619
  214. noshot/data/ML TS XAI/NLP/NLP 5/sample1.txt +0 -15
  215. noshot/data/ML TS XAI/NLP/NLP 5/sample2.txt +0 -4
  216. noshot/data/ML TS XAI/NLP/NLP 5/word2vec_model.bin +0 -0
  217. noshot/data/ML TS XAI/NLP/NLP 6/1. Tokenize, Tagging, NER, Parse Tree.ipynb +0 -312
  218. noshot/data/ML TS XAI/NLP/NLP 6/2. T Test and Chi2 Test.ipynb +0 -185
  219. noshot/data/ML TS XAI/NLP/NLP 6/3. Naive Bayes WSD.ipynb +0 -199
  220. noshot/data/ML TS XAI/NLP/NLP 6/4. Hinddle and Rooth.ipynb +0 -151
  221. noshot/data/ML TS XAI/NLP/NLP 6/5 and 6 FWD, BWD, Viterbi.ipynb +0 -164
  222. noshot/data/ML TS XAI/NLP/NLP 6/7. PCFG using CYK.ipynb +0 -383
  223. noshot/data/ML TS XAI/NLP/NLP 6/8. BOW and TF-IDF.ipynb +0 -252
  224. noshot/data/ML TS XAI/Ubuntu CN Lab.iso +0 -0
  225. noshot-0.1.6.dist-info/RECORD +0 -216
  226. {noshot-0.1.6.dist-info → noshot-0.1.8.dist-info}/LICENSE.txt +0 -0
  227. {noshot-0.1.6.dist-info → noshot-0.1.8.dist-info}/WHEEL +0 -0
  228. {noshot-0.1.6.dist-info → noshot-0.1.8.dist-info}/top_level.txt +0 -0
@@ -1,188 +0,0 @@
1
- {
2
- "nbformat": 4,
3
- "nbformat_minor": 0,
4
- "metadata": {
5
- "colab": {
6
- "provenance": []
7
- },
8
- "kernelspec": {
9
- "name": "python3",
10
- "display_name": "Python 3"
11
- },
12
- "language_info": {
13
- "name": "python"
14
- }
15
- },
16
- "cells": [
17
- {
18
- "cell_type": "code",
19
- "execution_count": null,
20
- "metadata": {
21
- "colab": {
22
- "base_uri": "https://localhost:8080/"
23
- },
24
- "id": "DF_ZwwBZYlOy",
25
- "outputId": "b520aae1-aca8-419e-d136-bf777f5b9d7f"
26
- },
27
- "outputs": [
28
- {
29
- "output_type": "stream",
30
- "name": "stderr",
31
- "text": [
32
- "[nltk_data] Downloading package stopwords to /root/nltk_data...\n",
33
- "[nltk_data] Package stopwords is already up-to-date!\n",
34
- "[nltk_data] Downloading package punkt to /root/nltk_data...\n",
35
- "[nltk_data] Package punkt is already up-to-date!\n"
36
- ]
37
- },
38
- {
39
- "output_type": "execute_result",
40
- "data": {
41
- "text/plain": [
42
- "True"
43
- ]
44
- },
45
- "metadata": {},
46
- "execution_count": 2
47
- }
48
- ],
49
- "source": [
50
- "import nltk\n",
51
- "nltk.download('stopwords')\n",
52
- "nltk.download('punkt')"
53
- ]
54
- },
55
- {
56
- "cell_type": "code",
57
- "source": [
58
- "from nltk.corpus import stopwords\n",
59
- "from nltk.tokenize import word_tokenize\n",
60
- "\n",
61
- "f=open(\"/content/sample.txt\",\"r\")\n",
62
- "text=f.read()\n",
63
- "\n",
64
- "stop_words = set(stopwords.words(\"english\"))\n",
65
- "word_tokens = word_tokenize(text)\n",
66
- "fil_text = [word for word in word_tokens if word not in stop_words]\n",
67
- "print(word_tokens)\n"
68
- ],
69
- "metadata": {
70
- "colab": {
71
- "base_uri": "https://localhost:8080/"
72
- },
73
- "id": "p1EFKoWCYmtH",
74
- "outputId": "4a56d953-65bf-4924-8bdb-91a976a3af47"
75
- },
76
- "execution_count": null,
77
- "outputs": [
78
- {
79
- "output_type": "stream",
80
- "name": "stdout",
81
- "text": [
82
- "['hi', 'this', 'is', 'a', 'sample', 'text', 'for', 'natural', 'language', 'processing', 'natural', 'language', 'processing', 'has', 'various', 'advantages', '.']\n"
83
- ]
84
- }
85
- ]
86
- },
87
- {
88
- "cell_type": "code",
89
- "source": [
90
- "def collocation(w1,w2):\n",
91
- " nl=list()\n",
92
- " N=len(word_tokens)\n",
93
- " pw1=word_tokens.count(w1)\n",
94
- " pw2=word_tokens.count(w2)\n",
95
- " md=((pw1/N)*(pw2/N))\n",
96
- " j=0\n",
97
- " for i in range(len(word_tokens)):\n",
98
- " if(word_tokens[i]==w1 and word_tokens[i+1]==w2):\n",
99
- " j=j+1\n",
100
- " pw12=j\n",
101
- " x=pw12/N\n",
102
- " s2=x\n",
103
- " t=(x-md)/(x/N)**0.5\n",
104
- " if(float(t) > float(cv)):\n",
105
- " print(\"hypothesis rejected thus the given words( \",w1,\" \",w2,\" ) form a collocation\")\n",
106
- " print(t)\n",
107
- " nl.append(w1)\n",
108
- " nl.append(w2)\n",
109
- " nl.append(t)\n",
110
- " return nl"
111
- ],
112
- "metadata": {
113
- "id": "F_3yVJF-Ys19"
114
- },
115
- "execution_count": null,
116
- "outputs": []
117
- },
118
- {
119
- "cell_type": "code",
120
- "source": [
121
- "cv=input(\"enter the critical value : \")"
122
- ],
123
- "metadata": {
124
- "colab": {
125
- "base_uri": "https://localhost:8080/"
126
- },
127
- "id": "A2sGU4O2alhl",
128
- "outputId": "dd8df949-19d2-441e-f421-1bca5f1fe98e"
129
- },
130
- "execution_count": null,
131
- "outputs": [
132
- {
133
- "name": "stdout",
134
- "output_type": "stream",
135
- "text": [
136
- "enter the critical value : 1\n"
137
- ]
138
- }
139
- ]
140
- },
141
- {
142
- "cell_type": "code",
143
- "source": [
144
- "fcol=list()\n",
145
- "for i in range(len(word_tokens)-1):\n",
146
- " w1=word_tokens[i]\n",
147
- " w2=word_tokens[i+1]\n",
148
- " fcol.append(collocation(w1,w2))\n",
149
- "for i in fcol:\n",
150
- " if(len(i) > 1):\n",
151
- " if(fcol.count(i)>1):\n",
152
- " fcol.remove(i)\n",
153
- " else:\n",
154
- " fcol.remove(i)\n",
155
- " \n",
156
- "for i in fcol:\n",
157
- " if(len(i) > 1):\n",
158
- " print(i)"
159
- ],
160
- "metadata": {
161
- "colab": {
162
- "base_uri": "https://localhost:8080/"
163
- },
164
- "id": "rdNNhGmUYzC2",
165
- "outputId": "dc8b4b05-c546-4600-ae7c-c62bc3ed5ed5"
166
- },
167
- "execution_count": null,
168
- "outputs": [
169
- {
170
- "output_type": "stream",
171
- "name": "stdout",
172
- "text": [
173
- "hypothesis rejected thus the given words( natural language ) form a collocation\n",
174
- "1.2478354962115543\n",
175
- "hypothesis rejected thus the given words( language processing ) form a collocation\n",
176
- "1.2478354962115543\n",
177
- "hypothesis rejected thus the given words( natural language ) form a collocation\n",
178
- "1.2478354962115543\n",
179
- "hypothesis rejected thus the given words( language processing ) form a collocation\n",
180
- "1.2478354962115543\n",
181
- "['natural', 'language', 1.2478354962115543]\n",
182
- "['language', 'processing', 1.2478354962115543]\n"
183
- ]
184
- }
185
- ]
186
- }
187
- ]
188
- }
@@ -1,437 +0,0 @@
1
- {
2
- "nbformat": 4,
3
- "nbformat_minor": 0,
4
- "metadata": {
5
- "colab": {
6
- "provenance": []
7
- },
8
- "kernelspec": {
9
- "name": "python3",
10
- "display_name": "Python 3"
11
- },
12
- "language_info": {
13
- "name": "python"
14
- }
15
- },
16
- "cells": [
17
- {
18
- "cell_type": "code",
19
- "execution_count": null,
20
- "metadata": {
21
- "colab": {
22
- "base_uri": "https://localhost:8080/"
23
- },
24
- "id": "pp2qf3zYXaiT",
25
- "outputId": "873c7148-85ea-4ff2-eca1-5fc88f5af441"
26
- },
27
- "outputs": [
28
- {
29
- "output_type": "stream",
30
- "name": "stdout",
31
- "text": [
32
- "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
33
- "Requirement already satisfied: spacy in /usr/local/lib/python3.8/dist-packages (3.4.4)\n",
34
- "Requirement already satisfied: pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4 in /usr/local/lib/python3.8/dist-packages (from spacy) (1.10.4)\n",
35
- "Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from spacy) (2.0.7)\n",
36
- "Requirement already satisfied: setuptools in /usr/local/lib/python3.8/dist-packages (from spacy) (57.4.0)\n",
37
- "Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (4.64.1)\n",
38
- "Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (1.0.9)\n",
39
- "Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.10 in /usr/local/lib/python3.8/dist-packages (from spacy) (3.0.11)\n",
40
- "Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.8/dist-packages (from spacy) (2.0.8)\n",
41
- "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (21.3)\n",
42
- "Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.8/dist-packages (from spacy) (3.0.8)\n",
43
- "Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (2.25.1)\n",
44
- "Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /usr/local/lib/python3.8/dist-packages (from spacy) (2.4.5)\n",
45
- "Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (1.0.4)\n",
46
- "Requirement already satisfied: typer<0.8.0,>=0.3.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (0.7.0)\n",
47
- "Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (3.3.0)\n",
48
- "Requirement already satisfied: numpy>=1.15.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (1.21.6)\n",
49
- "Requirement already satisfied: pathy>=0.3.5 in /usr/local/lib/python3.8/dist-packages (from spacy) (0.10.1)\n",
50
- "Requirement already satisfied: wasabi<1.1.0,>=0.9.1 in /usr/local/lib/python3.8/dist-packages (from spacy) (0.10.1)\n",
51
- "Requirement already satisfied: thinc<8.2.0,>=8.1.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (8.1.6)\n",
52
- "Requirement already satisfied: jinja2 in /usr/local/lib/python3.8/dist-packages (from spacy) (2.11.3)\n",
53
- "Requirement already satisfied: smart-open<7.0.0,>=5.2.1 in /usr/local/lib/python3.8/dist-packages (from spacy) (6.3.0)\n",
54
- "Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from packaging>=20.0->spacy) (3.0.9)\n",
55
- "Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.8/dist-packages (from pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4->spacy) (4.4.0)\n",
56
- "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (2.10)\n",
57
- "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (2022.12.7)\n",
58
- "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (1.24.3)\n",
59
- "Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (4.0.0)\n",
60
- "Requirement already satisfied: blis<0.8.0,>=0.7.8 in /usr/local/lib/python3.8/dist-packages (from thinc<8.2.0,>=8.1.0->spacy) (0.7.9)\n",
61
- "Requirement already satisfied: confection<1.0.0,>=0.0.1 in /usr/local/lib/python3.8/dist-packages (from thinc<8.2.0,>=8.1.0->spacy) (0.0.3)\n",
62
- "Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.8/dist-packages (from typer<0.8.0,>=0.3.0->spacy) (7.1.2)\n",
63
- "Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.8/dist-packages (from jinja2->spacy) (2.0.1)\n",
64
- "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
65
- "Requirement already satisfied: nltk in /usr/local/lib/python3.8/dist-packages (3.7)\n",
66
- "Requirement already satisfied: regex>=2021.8.3 in /usr/local/lib/python3.8/dist-packages (from nltk) (2022.6.2)\n",
67
- "Requirement already satisfied: tqdm in /usr/local/lib/python3.8/dist-packages (from nltk) (4.64.1)\n",
68
- "Requirement already satisfied: click in /usr/local/lib/python3.8/dist-packages (from nltk) (7.1.2)\n",
69
- "Requirement already satisfied: joblib in /usr/local/lib/python3.8/dist-packages (from nltk) (1.2.0)\n",
70
- "/usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:497: UserWarning: Can't initialize NVML\n",
71
- " warnings.warn(\"Can't initialize NVML\")\n",
72
- "2023-01-31 10:28:37.313611: E tensorflow/stream_executor/cuda/cuda_driver.cc:271] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected\n",
73
- "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
74
- "Collecting en-core-web-sm==3.4.1\n",
75
- " Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.4.1/en_core_web_sm-3.4.1-py3-none-any.whl (12.8 MB)\n",
76
- "\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.8/12.8 MB\u001b[0m \u001b[31m19.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
77
- "\u001b[?25hRequirement already satisfied: spacy<3.5.0,>=3.4.0 in /usr/local/lib/python3.8/dist-packages (from en-core-web-sm==3.4.1) (3.4.4)\n",
78
- "Requirement already satisfied: thinc<8.2.0,>=8.1.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (8.1.6)\n",
79
- "Requirement already satisfied: pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (1.10.4)\n",
80
- "Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.10 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (3.0.11)\n",
81
- "Requirement already satisfied: setuptools in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (57.4.0)\n",
82
- "Requirement already satisfied: pathy>=0.3.5 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (0.10.1)\n",
83
- "Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (3.3.0)\n",
84
- "Requirement already satisfied: wasabi<1.1.0,>=0.9.1 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (0.10.1)\n",
85
- "Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (1.0.9)\n",
86
- "Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (3.0.8)\n",
87
- "Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (21.3)\n",
88
- "Requirement already satisfied: smart-open<7.0.0,>=5.2.1 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (6.3.0)\n",
89
- "Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.0.8)\n",
90
- "Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.4.5)\n",
91
- "Requirement already satisfied: numpy>=1.15.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (1.21.6)\n",
92
- "Requirement already satisfied: typer<0.8.0,>=0.3.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (0.7.0)\n",
93
- "Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (1.0.4)\n",
94
- "Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (4.64.1)\n",
95
- "Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.0.7)\n",
96
- "Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.25.1)\n",
97
- "Requirement already satisfied: jinja2 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.11.3)\n",
98
- "Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from packaging>=20.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (3.0.9)\n",
99
- "Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.8/dist-packages (from pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (4.4.0)\n",
100
- "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2022.12.7)\n",
101
- "Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (4.0.0)\n",
102
- "Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (1.24.3)\n",
103
- "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.10)\n",
104
- "Requirement already satisfied: blis<0.8.0,>=0.7.8 in /usr/local/lib/python3.8/dist-packages (from thinc<8.2.0,>=8.1.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (0.7.9)\n",
105
- "Requirement already satisfied: confection<1.0.0,>=0.0.1 in /usr/local/lib/python3.8/dist-packages (from thinc<8.2.0,>=8.1.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (0.0.3)\n",
106
- "Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.8/dist-packages (from typer<0.8.0,>=0.3.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (7.1.2)\n",
107
- "Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.8/dist-packages (from jinja2->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.0.1)\n",
108
- "\u001b[38;5;2m✔ Download and installation successful\u001b[0m\n",
109
- "You can now load the package via spacy.load('en_core_web_sm')\n"
110
- ]
111
- }
112
- ],
113
- "source": [
114
- "! pip install spacy\n",
115
- "! pip install nltk\n",
116
- "! python -m spacy download en_core_web_sm"
117
- ]
118
- },
119
- {
120
- "cell_type": "code",
121
- "source": [
122
- "import spacy\n",
123
- "from spacy import displacy\n",
124
- "from spacy import tokenizer\n",
125
- "nlp = spacy.load('en_core_web_sm')"
126
- ],
127
- "metadata": {
128
- "colab": {
129
- "base_uri": "https://localhost:8080/"
130
- },
131
- "id": "SABsAqWUXegn",
132
- "outputId": "2f89e0c5-66b1-4b1d-b901-0551104d9488"
133
- },
134
- "execution_count": null,
135
- "outputs": [
136
- {
137
- "output_type": "stream",
138
- "name": "stderr",
139
- "text": [
140
- "/usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:497: UserWarning: Can't initialize NVML\n",
141
- " warnings.warn(\"Can't initialize NVML\")\n"
142
- ]
143
- }
144
- ]
145
- },
146
- {
147
- "cell_type": "code",
148
- "source": [
149
- "text =(\"Python is an interpreted, high-level and general-purpose programming language\"\n",
150
- " \"Pythons design philosophy emphasizes code readability with\"\n",
151
- " \"its notable use of significant indentation.\"\n",
152
- " \"Its language constructs and object-oriented approach aim to\"\n",
153
- " \"help programmers write clear and\"\n",
154
- " \"logical code for small and large-scale projects\")"
155
- ],
156
- "metadata": {
157
- "id": "5P2nQrbeXjGu"
158
- },
159
- "execution_count": null,
160
- "outputs": []
161
- },
162
- {
163
- "cell_type": "code",
164
- "source": [
165
- "doc = nlp(text)\n",
166
- "#doc2 = nlp(text2)\n",
167
- "sentences = list(doc.sents)\n",
168
- "print(sentences)\n",
169
- "# tokenization\n",
170
- "for token in doc:\n",
171
- " print(token.text)\n",
172
- "# print entities\n",
173
- "ents = [(e.text, e.start_char, e.end_char, e.label_) for e in doc.ents]\n",
174
- "print(ents)\n",
175
- "# now we use displaycy function on doc2\n",
176
- "displacy.render(doc, style='ent', jupyter=True)"
177
- ],
178
- "metadata": {
179
- "colab": {
180
- "base_uri": "https://localhost:8080/",
181
- "height": 975
182
- },
183
- "id": "J5huMlqAXmam",
184
- "outputId": "361b18ee-7b5e-4ede-e824-c548f918555d"
185
- },
186
- "execution_count": null,
187
- "outputs": [
188
- {
189
- "output_type": "stream",
190
- "name": "stdout",
191
- "text": [
192
- "[Python is an interpreted, high-level and general-purpose programming languagePythons design philosophy emphasizes code readability withits notable use of significant indentation., Its language constructs and object-oriented approach aim tohelp programmers write clear andlogical code for small and large-scale projects]\n",
193
- "Python\n",
194
- "is\n",
195
- "an\n",
196
- "interpreted\n",
197
- ",\n",
198
- "high\n",
199
- "-\n",
200
- "level\n",
201
- "and\n",
202
- "general\n",
203
- "-\n",
204
- "purpose\n",
205
- "programming\n",
206
- "languagePythons\n",
207
- "design\n",
208
- "philosophy\n",
209
- "emphasizes\n",
210
- "code\n",
211
- "readability\n",
212
- "withits\n",
213
- "notable\n",
214
- "use\n",
215
- "of\n",
216
- "significant\n",
217
- "indentation\n",
218
- ".\n",
219
- "Its\n",
220
- "language\n",
221
- "constructs\n",
222
- "and\n",
223
- "object\n",
224
- "-\n",
225
- "oriented\n",
226
- "approach\n",
227
- "aim\n",
228
- "tohelp\n",
229
- "programmers\n",
230
- "write\n",
231
- "clear\n",
232
- "andlogical\n",
233
- "code\n",
234
- "for\n",
235
- "small\n",
236
- "and\n",
237
- "large\n",
238
- "-\n",
239
- "scale\n",
240
- "projects\n",
241
- "[('languagePythons', 69, 84, 'PERSON')]\n"
242
- ]
243
- },
244
- {
245
- "output_type": "display_data",
246
- "data": {
247
- "text/plain": [
248
- "<IPython.core.display.HTML object>"
249
- ],
250
- "text/html": [
251
- "<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">Python is an interpreted, high-level and general-purpose programming \n",
252
- "<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
253
- " languagePythons\n",
254
- " <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
255
- "</mark>\n",
256
- " design philosophy emphasizes code readability withits notable use of significant indentation.Its language constructs and object-oriented approach aim tohelp programmers write clear andlogical code for small and large-scale projects</div></span>"
257
- ]
258
- },
259
- "metadata": {}
260
- }
261
- ]
262
- },
263
- {
264
- "cell_type": "code",
265
- "source": [
266
- "import nltk\n",
267
- "nltk.download('words')\n",
268
- "nltk.download('punkt')\n",
269
- "nltk.download('maxent_ne_chunker')\n",
270
- "nltk.download('averaged_perceptron_tagger')\n",
271
- "nltk.download('state_union')\n",
272
- "from nltk.corpus import state_union\n",
273
- "from nltk.tokenize import PunktSentenceTokenizer\n",
274
- " \n",
275
- "# process the text and print Named entities\n",
276
- "# tokenization\n",
277
- "train_text = state_union.raw()\n",
278
- " \n",
279
- "sample_text = state_union.raw(\"2006-GWBush.txt\")\n",
280
- "custom_sent_tokenizer = PunktSentenceTokenizer(train_text)\n",
281
- "tokenized = custom_sent_tokenizer.tokenize(sample_text)\n",
282
- "# function"
283
- ],
284
- "metadata": {
285
- "colab": {
286
- "base_uri": "https://localhost:8080/"
287
- },
288
- "id": "szBuYQgmYeQv",
289
- "outputId": "28feaa55-ecf8-4842-92ff-5c5bbe390611"
290
- },
291
- "execution_count": null,
292
- "outputs": [
293
- {
294
- "output_type": "stream",
295
- "name": "stderr",
296
- "text": [
297
- "[nltk_data] Downloading package words to /root/nltk_data...\n",
298
- "[nltk_data] Package words is already up-to-date!\n",
299
- "[nltk_data] Downloading package punkt to /root/nltk_data...\n",
300
- "[nltk_data] Package punkt is already up-to-date!\n",
301
- "[nltk_data] Downloading package maxent_ne_chunker to\n",
302
- "[nltk_data] /root/nltk_data...\n",
303
- "[nltk_data] Package maxent_ne_chunker is already up-to-date!\n",
304
- "[nltk_data] Downloading package averaged_perceptron_tagger to\n",
305
- "[nltk_data] /root/nltk_data...\n",
306
- "[nltk_data] Package averaged_perceptron_tagger is already up-to-\n",
307
- "[nltk_data] date!\n",
308
- "[nltk_data] Downloading package state_union to /root/nltk_data...\n",
309
- "[nltk_data] Package state_union is already up-to-date!\n"
310
- ]
311
- }
312
- ]
313
- },
314
- {
315
- "cell_type": "code",
316
- "source": [
317
- "for i in tokenized:\n",
318
- " words = nltk.word_tokenize(i)\n",
319
- " tagged = nltk.pos_tag(words)\n",
320
- " if(tagged[0][1]==\"NN\"):\n",
321
- " print(tagged[0])\n",
322
- " "
323
- ],
324
- "metadata": {
325
- "colab": {
326
- "base_uri": "https://localhost:8080/"
327
- },
328
- "id": "qtQScPTkZzjw",
329
- "outputId": "af00a285-434a-4f53-b406-5af7231a31e8"
330
- },
331
- "execution_count": null,
332
- "outputs": [
333
- {
334
- "output_type": "stream",
335
- "name": "stdout",
336
- "text": [
337
- "('Tonight', 'NN')\n",
338
- "('Today', 'NN')\n",
339
- "('Tonight', 'NN')\n",
340
- "('Welfare', 'NN')\n",
341
- "('Drug', 'NN')\n",
342
- "('Today', 'NN')\n",
343
- "('Today', 'NN')\n"
344
- ]
345
- }
346
- ]
347
- },
348
- {
349
- "cell_type": "code",
350
- "source": [
351
- "f=open(\"ex1nlptextdata.txt\",\"r\")\n",
352
- "data=f.read()\n"
353
- ],
354
- "metadata": {
355
- "id": "64t3uZ95bFmW"
356
- },
357
- "execution_count": null,
358
- "outputs": []
359
- },
360
- {
361
- "cell_type": "code",
362
- "source": [
363
- "txtdat=data.split(\" \")\n",
364
- "print(txtdat)"
365
- ],
366
- "metadata": {
367
- "colab": {
368
- "base_uri": "https://localhost:8080/"
369
- },
370
- "id": "9c3WplVzdhE_",
371
- "outputId": "58c559f7-fdfe-451b-a342-c032f74f00ef"
372
- },
373
- "execution_count": null,
374
- "outputs": [
375
- {
376
- "output_type": "stream",
377
- "name": "stdout",
378
- "text": [
379
- "['Python', 'is', 'a', 'high-level,', 'general-purpose', 'programming', 'language.', 'Its', 'design', 'philosophy', 'emphasizes', 'code', 'readability', 'with', 'the', 'use', 'of', 'significant', 'indentation.[33]\\n\\nPython', 'is', 'dynamically', 'typed', 'and', 'garbage-collected.', 'It', 'supports', 'multiple', 'programming', 'paradigms,', 'including', 'structured', '(particularly', 'procedural),', 'object-oriented', 'and', 'functional', 'programming.', '\\nRather', 'than', 'building', 'all', 'of', 'its', 'functionality', 'into', 'its', 'core,', '\\nPython', 'was', 'designed', 'to', 'be', 'highly', 'extensible', 'via', 'modules.', 'This\\ncompact', 'modularity', 'has', 'made', 'it', 'particularly', 'popular', 'as', 'a', 'means\\nof', 'adding', 'programmable', 'interfaces', 'to', 'existing', 'applications.\\nVan', \"Rossum's\", 'vision', 'of', 'a', 'small', 'core', 'language', 'with', 'a', 'large', 'standard', 'library', 'and', 'easily', 'extensible', 'interpreter', 'stemmed', 'from', 'his', 'frustrations', 'with', 'ABC,', 'which', 'espoused', 'the', 'opposite', 'approach\\n']\n"
380
- ]
381
- }
382
- ]
383
- },
384
- {
385
- "cell_type": "code",
386
- "source": [
387
- "for i in txtdat:\n",
388
- " words = nltk.word_tokenize(i)\n",
389
- " tagged = nltk.pos_tag(words)\n",
390
- " if(tagged[0][1]==\"NN\"):\n",
391
- " print(tagged[0])"
392
- ],
393
- "metadata": {
394
- "colab": {
395
- "base_uri": "https://localhost:8080/"
396
- },
397
- "id": "qtfZyvXMdjc2",
398
- "outputId": "cc15222b-b340-4140-d6f4-0c0f15c0b3e8"
399
- },
400
- "execution_count": null,
401
- "outputs": [
402
- {
403
- "output_type": "stream",
404
- "name": "stdout",
405
- "text": [
406
- "('Python', 'NN')\n",
407
- "('high-level', 'NN')\n",
408
- "('language', 'NN')\n",
409
- "('design', 'NN')\n",
410
- "('philosophy', 'NN')\n",
411
- "('code', 'NN')\n",
412
- "('readability', 'NN')\n",
413
- "('use', 'NN')\n",
414
- "('indentation', 'NN')\n",
415
- "('multiple', 'NN')\n",
416
- "('paradigms', 'NN')\n",
417
- "('procedural', 'NN')\n",
418
- "('programming', 'NN')\n",
419
- "('building', 'NN')\n",
420
- "('functionality', 'NN')\n",
421
- "('core', 'NN')\n",
422
- "('Python', 'NN')\n",
423
- "('modularity', 'NN')\n",
424
- "('vision', 'NN')\n",
425
- "('core', 'NN')\n",
426
- "('language', 'NN')\n",
427
- "('standard', 'NN')\n",
428
- "('library', 'NN')\n",
429
- "('interpreter', 'NN')\n",
430
- "('opposite', 'NN')\n",
431
- "('approach', 'NN')\n"
432
- ]
433
- }
434
- ]
435
- }
436
- ]
437
- }