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,295 +0,0 @@
1
- {
2
- "cells": [
3
- {
4
- "cell_type": "code",
5
- "execution_count": 28,
6
- "id": "5b6bc416-8477-4c54-b86c-2bff22b277c5",
7
- "metadata": {},
8
- "outputs": [
9
- {
10
- "name": "stdout",
11
- "output_type": "stream",
12
- "text": [
13
- "Vocabulary:\n",
14
- " ['1996' '2003' '2005' '2011' '2012' '302' '408' '430' '736' '85' 'absenc'\n",
15
- " 'abus' 'accur' 'across' 'act' 'action' 'address' 'administr' 'affair'\n",
16
- " 'affect' 'agenc' 'allow' 'along' 'also' 'anticip' 'apart' 'applic' 'argu'\n",
17
- " 'argument' 'art' 'assert' 'assist' 'associ' 'assum' 'attain' 'attempt'\n",
18
- " 'attribut' 'autocrat' 'autonomi' 'avail' 'avoid' 'balanc' 'basic' 'becom'\n",
19
- " 'benefit' 'best' 'boast' 'break' 'bring' 'brought' 'cent' 'challeng'\n",
20
- " 'check' 'civil' 'commit' 'commun' 'compet' 'comprehend' 'compris'\n",
21
- " 'concept' 'conclud' 'conclus' 'confront' 'consider' 'constitut'\n",
22
- " 'contemporari' 'control' 'core' 'correctli' 'corrupt' 'countri' 'crisi'\n",
23
- " 'current' 'curtail' 'de' 'deliveri' 'democraci' 'democrat' 'depend'\n",
24
- " 'deriv' 'desir' 'develop' 'directli' 'discov' 'discuss' 'dissemin'\n",
25
- " 'divers' 'easili' 'econom' 'effect' 'el' 'elect' 'emerg' 'enhanc'\n",
26
- " 'enshrin' 'equal' 'erupt' 'especi' 'even' 'exampl' 'exercis' 'expect'\n",
27
- " 'expens' 'express' 'face' 'facilit' 'fact' 'fail' 'fear' 'final' 'find'\n",
28
- " 'flourish' 'flow' 'foundat' 'free' 'freedom' 'freeli' 'fuell' 'fulfil'\n",
29
- " 'fulli' 'funct' 'gag' 'gain' 'gather' 'given' 'global' 'globe' 'good'\n",
30
- " 'govern' 'greatli' 'group' 'guarante' 'hamilton' 'hand' 'hardli' 'haskin'\n",
31
- " 'heard' 'howev' 'human' 'idea' 'ideolog' 'illiber' 'impact' 'implement'\n",
32
- " 'impli' 'implic' 'impun' 'inadequ' 'includ' 'indec' 'individu' 'infiltr'\n",
33
- " 'inform' 'inner' 'instanc' 'interpret' 'intimid' 'isol' 'issu' 'justifi'\n",
34
- " 'larg' 'law' 'lay' 'liber' 'limelight' 'limit' 'link' 'listen'\n",
35
- " 'literatur' 'long' 'made' 'mani' 'martã' 'materi' 'may' 'measur'\n",
36
- " 'mention' 'must' 'myriad' 'necessari' 'neg' 'non' 'object' 'offer'\n",
37
- " 'often' 'one' 'oneself' 'open' 'oper' 'opinion' 'oppos' 'opt' 'origin'\n",
38
- " 'outcom' 'overshadow' 'part' 'peopl' 'pertin' 'pillar' 'place' 'platform'\n",
39
- " 'polit' 'poor' 'por' 'pornograph' 'possibl' 'power' 'practic' 'press'\n",
40
- " 'problem' 'process' 'properli' 'propon' 'provis' 'prudent' 'put' 'realiz'\n",
41
- " 'recal' 'receiv' 'regim' 'regulatori' 'relentless' 'render' 'respect'\n",
42
- " 'result' 'right' 'safeti' 'scapegoat' 'search' 'self' 'separat' 'sever'\n",
43
- " 'share' 'silenc' 'sinc' 'situat' 'social' 'societi' 'socio' 'solut'\n",
44
- " 'somalia' 'southern' 'special' 'speech' 'spite' 'state' 'sturg' 'sub'\n",
45
- " 'sudan' 'suffer' 'sway' 'syria' 'taint' 'take' 'temperman' 'tend' 'tenet'\n",
46
- " 'theorist' 'though' 'thought' 'time' 'torn' 'totalitarian' 'truth'\n",
47
- " 'typic' 'ukrain' 'umbrella' 'understand' 'unless' 'use' 'valu' 'valv'\n",
48
- " 'verdict' 'viewpoint' 'violenc' 'vital' 'war' 'weak' 'weaken' 'well'\n",
49
- " 'whenev' 'without' 'word' 'world' 'worsen' 'wrong' 'zaya']\n",
50
- "\n",
51
- "Bag of Words (Vectorization):\n",
52
- " [[ 2 1 1 1 1 1 1 1 1 2 3 3 1 3 1 1 1 1 1 2 1 2 1 5\n",
53
- " 1 1 1 3 3 1 1 2 2 1 1 1 1 1 1 1 1 1 2 1 4 1 1 1\n",
54
- " 1 2 1 1 1 1 1 2 1 1 1 1 1 1 1 1 1 1 1 1 1 1 2 1\n",
55
- " 1 1 1 1 1 3 1 1 1 1 2 1 1 1 1 2 1 1 1 1 1 2 1 1\n",
56
- " 1 1 2 2 1 1 1 23 1 1 1 1 1 1 1 1 1 1 2 32 1 1 2 1\n",
57
- " 1 1 2 1 1 1 1 1 7 1 1 1 1 1 1 2 1 1 3 1 1 2 1 1\n",
58
- " 2 1 1 1 2 1 3 1 3 1 3 1 1 1 2 1 2 1 1 1 1 2 1 1\n",
59
- " 1 1 1 1 1 1 3 1 1 1 1 1 2 1 1 2 1 1 2 1 1 4 1 1\n",
60
- " 1 1 1 1 2 1 1 1 1 4 1 1 1 2 1 3 2 1 1 1 2 1 1 2\n",
61
- " 1 1 1 3 1 1 1 1 2 8 1 1 1 2 1 1 2 1 1 1 2 7 1 1\n",
62
- " 1 1 1 11 1 3 1 1 1 1 1 1 1 2 1 1 1 1 1 1 2 1 1 3\n",
63
- " 1 1 1 1 1 3 2 1 1 2 1 1 2 1 1 1 1 1 1 2 1 2 1]]\n",
64
- "TF-IDF Vocabulary: ['1996' '2003' '2005' '2011' '2012' '302' '408' '430' '736' '85' 'absenc'\n",
65
- " 'abus' 'accur' 'across' 'act' 'action' 'address' 'administr' 'affair'\n",
66
- " 'affect' 'agenc' 'allow' 'along' 'also' 'anticip' 'apart' 'applic' 'argu'\n",
67
- " 'argument' 'art' 'assert' 'assist' 'associ' 'assum' 'attain' 'attempt'\n",
68
- " 'attribut' 'autocrat' 'autonomi' 'avail' 'avoid' 'balanc' 'basic' 'becom'\n",
69
- " 'benefit' 'best' 'boast' 'break' 'bring' 'brought' 'cent' 'challeng'\n",
70
- " 'check' 'civil' 'commit' 'commun' 'compet' 'comprehend' 'compris'\n",
71
- " 'concept' 'conclud' 'conclus' 'confront' 'consider' 'constitut'\n",
72
- " 'contemporari' 'control' 'core' 'correctli' 'corrupt' 'countri' 'crisi'\n",
73
- " 'current' 'curtail' 'de' 'deliveri' 'democraci' 'democrat' 'depend'\n",
74
- " 'deriv' 'desir' 'develop' 'directli' 'discov' 'discuss' 'dissemin'\n",
75
- " 'divers' 'easili' 'econom' 'effect' 'el' 'elect' 'emerg' 'enhanc'\n",
76
- " 'enshrin' 'equal' 'erupt' 'especi' 'even' 'exampl' 'exercis' 'expect'\n",
77
- " 'expens' 'express' 'face' 'facilit' 'fact' 'fail' 'fear' 'final' 'find'\n",
78
- " 'flourish' 'flow' 'foundat' 'free' 'freedom' 'freeli' 'fuell' 'fulfil'\n",
79
- " 'fulli' 'funct' 'gag' 'gain' 'gather' 'given' 'global' 'globe' 'good'\n",
80
- " 'govern' 'greatli' 'group' 'guarante' 'hamilton' 'hand' 'hardli' 'haskin'\n",
81
- " 'heard' 'howev' 'human' 'idea' 'ideolog' 'illiber' 'impact' 'implement'\n",
82
- " 'impli' 'implic' 'impun' 'inadequ' 'includ' 'indec' 'individu' 'infiltr'\n",
83
- " 'inform' 'inner' 'instanc' 'interpret' 'intimid' 'isol' 'issu' 'justifi'\n",
84
- " 'larg' 'law' 'lay' 'liber' 'limelight' 'limit' 'link' 'listen'\n",
85
- " 'literatur' 'long' 'made' 'mani' 'martã' 'materi' 'may' 'measur'\n",
86
- " 'mention' 'must' 'myriad' 'necessari' 'neg' 'non' 'object' 'offer'\n",
87
- " 'often' 'one' 'oneself' 'open' 'oper' 'opinion' 'oppos' 'opt' 'origin'\n",
88
- " 'outcom' 'overshadow' 'part' 'peopl' 'pertin' 'pillar' 'place' 'platform'\n",
89
- " 'polit' 'poor' 'por' 'pornograph' 'possibl' 'power' 'practic' 'press'\n",
90
- " 'problem' 'process' 'properli' 'propon' 'provis' 'prudent' 'put' 'realiz'\n",
91
- " 'recal' 'receiv' 'regim' 'regulatori' 'relentless' 'render' 'respect'\n",
92
- " 'result' 'right' 'safeti' 'scapegoat' 'search' 'self' 'separat' 'sever'\n",
93
- " 'share' 'silenc' 'sinc' 'situat' 'social' 'societi' 'socio' 'solut'\n",
94
- " 'somalia' 'southern' 'special' 'speech' 'spite' 'state' 'sturg' 'sub'\n",
95
- " 'sudan' 'suffer' 'sway' 'syria' 'taint' 'take' 'temperman' 'tend' 'tenet'\n",
96
- " 'theorist' 'though' 'thought' 'time' 'torn' 'totalitarian' 'truth'\n",
97
- " 'typic' 'ukrain' 'umbrella' 'understand' 'unless' 'use' 'valu' 'valv'\n",
98
- " 'verdict' 'viewpoint' 'violenc' 'vital' 'war' 'weak' 'weaken' 'well'\n",
99
- " 'whenev' 'without' 'word' 'world' 'worsen' 'wrong' 'zaya']\n",
100
- "\n",
101
- "TF-IDF Array: [[0.04043913 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956\n",
102
- " 0.02021956 0.02021956 0.02021956 0.04043913 0.06065869 0.06065869\n",
103
- " 0.02021956 0.06065869 0.02021956 0.02021956 0.02021956 0.02021956\n",
104
- " 0.02021956 0.04043913 0.02021956 0.04043913 0.02021956 0.10109782\n",
105
- " 0.02021956 0.02021956 0.02021956 0.06065869 0.06065869 0.02021956\n",
106
- " 0.02021956 0.04043913 0.04043913 0.02021956 0.02021956 0.02021956\n",
107
- " 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956\n",
108
- " 0.04043913 0.02021956 0.08087825 0.02021956 0.02021956 0.02021956\n",
109
- " 0.02021956 0.04043913 0.02021956 0.02021956 0.02021956 0.02021956\n",
110
- " 0.02021956 0.04043913 0.02021956 0.02021956 0.02021956 0.02021956\n",
111
- " 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956\n",
112
- " 0.02021956 0.02021956 0.02021956 0.02021956 0.04043913 0.02021956\n",
113
- " 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956 0.06065869\n",
114
- " 0.02021956 0.02021956 0.02021956 0.02021956 0.04043913 0.02021956\n",
115
- " 0.02021956 0.02021956 0.02021956 0.04043913 0.02021956 0.02021956\n",
116
- " 0.02021956 0.02021956 0.02021956 0.04043913 0.02021956 0.02021956\n",
117
- " 0.02021956 0.02021956 0.04043913 0.04043913 0.02021956 0.02021956\n",
118
- " 0.02021956 0.46504996 0.02021956 0.02021956 0.02021956 0.02021956\n",
119
- " 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956\n",
120
- " 0.04043913 0.64702603 0.02021956 0.02021956 0.04043913 0.02021956\n",
121
- " 0.02021956 0.02021956 0.04043913 0.02021956 0.02021956 0.02021956\n",
122
- " 0.02021956 0.02021956 0.14153694 0.02021956 0.02021956 0.02021956\n",
123
- " 0.02021956 0.02021956 0.02021956 0.04043913 0.02021956 0.02021956\n",
124
- " 0.06065869 0.02021956 0.02021956 0.04043913 0.02021956 0.02021956\n",
125
- " 0.04043913 0.02021956 0.02021956 0.02021956 0.04043913 0.02021956\n",
126
- " 0.06065869 0.02021956 0.06065869 0.02021956 0.06065869 0.02021956\n",
127
- " 0.02021956 0.02021956 0.04043913 0.02021956 0.04043913 0.02021956\n",
128
- " 0.02021956 0.02021956 0.02021956 0.04043913 0.02021956 0.02021956\n",
129
- " 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956\n",
130
- " 0.06065869 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956\n",
131
- " 0.04043913 0.02021956 0.02021956 0.04043913 0.02021956 0.02021956\n",
132
- " 0.04043913 0.02021956 0.02021956 0.08087825 0.02021956 0.02021956\n",
133
- " 0.02021956 0.02021956 0.02021956 0.02021956 0.04043913 0.02021956\n",
134
- " 0.02021956 0.02021956 0.02021956 0.08087825 0.02021956 0.02021956\n",
135
- " 0.02021956 0.04043913 0.02021956 0.06065869 0.04043913 0.02021956\n",
136
- " 0.02021956 0.02021956 0.04043913 0.02021956 0.02021956 0.04043913\n",
137
- " 0.02021956 0.02021956 0.02021956 0.06065869 0.02021956 0.02021956\n",
138
- " 0.02021956 0.02021956 0.04043913 0.16175651 0.02021956 0.02021956\n",
139
- " 0.02021956 0.04043913 0.02021956 0.02021956 0.04043913 0.02021956\n",
140
- " 0.02021956 0.02021956 0.04043913 0.14153694 0.02021956 0.02021956\n",
141
- " 0.02021956 0.02021956 0.02021956 0.2224152 0.02021956 0.06065869\n",
142
- " 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956\n",
143
- " 0.02021956 0.04043913 0.02021956 0.02021956 0.02021956 0.02021956\n",
144
- " 0.02021956 0.02021956 0.04043913 0.02021956 0.02021956 0.06065869\n",
145
- " 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956 0.06065869\n",
146
- " 0.04043913 0.02021956 0.02021956 0.04043913 0.02021956 0.02021956\n",
147
- " 0.04043913 0.02021956 0.02021956 0.02021956 0.02021956 0.02021956\n",
148
- " 0.02021956 0.04043913 0.02021956 0.04043913 0.02021956]]\n"
149
- ]
150
- }
151
- ],
152
- "source": [
153
- "import nltk\n",
154
- "from nltk.corpus import stopwords\n",
155
- "from nltk.tokenize import word_tokenize,sent_tokenize\n",
156
- "from nltk.stem import WordNetLemmatizer, PorterStemmer\n",
157
- "from sklearn.feature_extraction.text import CountVectorizer\n",
158
- "from sklearn.feature_extraction.text import TfidfVectorizer\n",
159
- "import string\n",
160
- "\n",
161
- "file_path = 'Freedom of expression.txt'\n",
162
- "with open(file_path, 'r') as file:\n",
163
- " text_data = file.read()\n",
164
- "stop_words = set(stopwords.words('english'))\n",
165
- "lemmatizer = WordNetLemmatizer()\n",
166
- "stemmer = PorterStemmer()\n",
167
- "def preprocess_text(text):\n",
168
- " tokens = word_tokenize(text.lower())\n",
169
- " processed_tokens = []\n",
170
- " for word in tokens:\n",
171
- " if word not in stop_words and word not in string.punctuation:\n",
172
- " lemmatized_word = lemmatizer.lemmatize(word) \n",
173
- " stemmed_word = stemmer.stem(lemmatized_word) \n",
174
- " processed_tokens.append(stemmed_word)\n",
175
- " return ' '.join(processed_tokens)\n",
176
- "preprocessed_text = preprocess_text(text_data)\n",
177
- "vectorizer = CountVectorizer()\n",
178
- "X = vectorizer.fit_transform([preprocessed_text])\n",
179
- "vocabulary = vectorizer.get_feature_names_out()\n",
180
- "bow_array = X.toarray()\n",
181
- "print(\"Vocabulary:\\n\", vocabulary)\n",
182
- "print(\"\\nBag of Words (Vectorization):\\n\", bow_array)\n",
183
- "\n",
184
- "tfidf_vectorizer=TfidfVectorizer()\n",
185
- "X_tfidf=tfidf_vectorizer.fit_transform([preprocessed_text])\n",
186
- "tfidf_vocabulary=tfidf_vectorizer.get_feature_names_out()\n",
187
- "tfidf_array=X_tfidf.toarray()\n",
188
- "print(\"TF-IDF Vocabulary:\",tfidf_vocabulary)\n",
189
- "print(\"\\nTF-IDF Array:\",tfidf_array)"
190
- ]
191
- },
192
- {
193
- "cell_type": "code",
194
- "execution_count": 33,
195
- "id": "824af76e-0a70-4e4f-aca6-7d9d9fcefed4",
196
- "metadata": {},
197
- "outputs": [
198
- {
199
- "name": "stdout",
200
- "output_type": "stream",
201
- "text": [
202
- "Sentence:'Freedom of expression is one of the basic tenets of human rights across the globe.' => Label: 'positive'\n",
203
- "Sentence:'It comprises of the freedom to express oneself without the fear of being intimidated, free delivery of the speech, liberated press, freedom to disseminate and receive information and the right to silence as well as free sharing of opinions (Temperman 2011, p.736).' => Label: 'positive'\n",
204
- "Sentence:'Freedom of expression or speech is valued across the world even though there have been, relentless attempts to curtail this provision by some illiberal and autocratic states.' => Label: 'positive'\n",
205
- "Sentence:'It is also prudent to mention that other sub-elements of human rights such as the right to take part in elections and the freedoms of association and thought are under the umbrella of freedoms of speech and expression.' => Label: 'positive'\n",
206
- "Sentence:'Also, the social rights of an individual are directly impacted by the freedom of expression rights.' => Label: 'positive'\n",
207
- "Sentence:'Governments should control freedom of speech since it has been abused.' => Label: 'positive'\n",
208
- "Sentence:'Proponents of freedom of expression argue that the concept has not been comprehended or interpreted correctly for a long time.' => Label: 'positive'\n",
209
- "Sentence:'They assert that freedom of expression has its limits.' => Label: 'positive'\n",
210
- "Sentence:'For instance, the rights of other people must be put into consideration before exercising the freedom to offer an opinion.' => Label: 'positive'\n",
211
- "Sentence:'It is necessary for governments and specialized agencies to understand that freedom of speech does not imply breaking the law with impunity.' => Label: 'positive'\n",
212
- "Sentence:'It is a basic right that facilitates the sharing of opinions and offers objective solutions to problems which face society.' => Label: 'neutral'\n",
213
- "Sentence:'The implementation of freedom of expression often brings about good results because pertinent issues that affect society are addressed.' => Label: 'positive'\n",
214
- "Sentence:'However, this democratic practice has been tainted by a few isolated individuals who become self-centered after attaining the anticipated gains.' => Label: 'neutral'\n",
215
- "Sentence:'Truth can only be discovered when there are competing ideologies and arguments.' => Label: 'neutral'\n",
216
- "Sentence:'Open discussions to issues affecting humanity may assist the process of searching for the truth.' => Label: 'neutral'\n",
217
- "Sentence:'These benefits cannot be realized in the absence of freedom of expression.' => Label: 'positive'\n",
218
- "Sentence:'A final and conclusive verdict can only be given after diverse ideas and viewpoints have been heard.' => Label: 'neutral'\n",
219
- "Sentence:'Several countries that allow freedom of expression do so to gather vital information that can be used to enhance socio-economic and political development (Hamilton & Pors 2003, p.408).' => Label: 'positive'\n",
220
- "Sentence:'The freedom of expression also lays the best foundation for self-fulfillment and autonomy in society.' => Label: 'positive'\n",
221
- "Sentence:'Apart from the fact that it assists in finding the truth, freedom of expression tends to fulfill the inner desire to express oneself whenever confronted by challenging situations.' => Label: 'positive'\n",
222
- "Sentence:'Unless freedom of expression is properly enshrined in our constitution, art and literature may equally suffer because they largely depend on the available platforms of freedom of speech to flourish.' => Label: 'positive'\n",
223
- "Sentence:'Democratic governments may be rendered non-functional in the absence of effective communication.' => Label: 'neutral'\n",
224
- "Sentence:'In other words, communication is a core operating pillar in governments that boast of democracy (Haskins 1996, p.85).' => Label: 'neutral'\n",
225
- "Sentence:'This implies that information should be allowed to flow freely to enhance the democratization of global regimes.' => Label: 'neutral'\n",
226
- "Sentence:'The gains that have been made in the administration of contemporary societies are directly linked to the freedoms of expression and speech.' => Label: 'positive'\n",
227
- "Sentence:'Some social and political theorists even argue that the freedom of expression acts as a safety valve in the political governance of state affairs (Haskins 1996, p.85).' => Label: 'positive'\n",
228
- "Sentence:'Checks and balances are only possible when the freedom of expression is fully guaranteed.' => Label: 'positive'\n",
229
- "Sentence:'For instance, it can be recalled that the emergence of totalitarian regimes and illiberal governments have been worsened by the absence or inadequate application of the freedom of speech.' => Label: 'positive'\n",
230
- "Sentence:'Some of these governments have opted to gag the press so that abuse of power and corruption cannot be brought into the limelight.' => Label: 'negative'\n",
231
- "Sentence:'On the other hand, freedom of expression has not brought along all the expected benefits as argued out by some proponents of the practice.' => Label: 'positive'\n",
232
- "Sentence:'For example, it is greatly assumed that all arguments that originate from the freedom of speech are accurate.' => Label: 'positive'\n",
233
- "Sentence:'Most individuals and groups hardly take the time to listen to opposing viewpoints (Sturges 2005, p.302).' => Label: 'neutral'\n",
234
- "Sentence:'As a result, they can easily sway the opinion of many people at the expense of society.' => Label: 'neutral'\n",
235
- "Sentence:'There are also myriads of instances when the freedom of speech has been used as a scapegoat to commit wrongs in society.' => Label: 'positive'\n",
236
- "Sentence:'In spite of the benefits derived from the freedom of speech, justifying wrong actions through the practice has weakened some values.' => Label: 'positive'\n",
237
- "Sentence:'Eruptions of violence and civil wars, especially in failed and weak states have been largely attributed to abuse of the freedom of expression.' => Label: 'positive'\n",
238
- "Sentence:'Typical examples include the war-torn countries such as Southern Sudan and Somalia.' => Label: 'neutral'\n",
239
- "Sentence:'The current political crises in Syria and Ukraine have also been fuelled by the poor use of the freedom of expression.' => Label: 'positive'\n",
240
- "Sentence:'Other negative implications of the freedom of expression include separatism and infiltration of pornographic and other indecent materials into society (de Zayas & Martín 2012, p.430).' => Label: 'positive'\n",
241
- "Sentence:'From the above arguments, it can be concluded that the freedom of expression should be limited by respective regimes across the world to avoid the possibility of negative outcomes.' => Label: 'positive'\n",
242
- "Sentence:'The benefits associated with the freedom of expression can be easily overshadowed if regulatory measures are not put in place.' => Label: 'positive'\n"
243
- ]
244
- }
245
- ],
246
- "source": [
247
- "with open(\"Freedom of expression.txt\",'r')as file:\n",
248
- " content=file.read()\n",
249
- "sentences=sent_tokenize(content)\n",
250
- "positive_keywords=['freedom','good','rights','express','benefits']\n",
251
- "negative_keywords=['abuse','control','violence','intimidated']\n",
252
- "def label_sentiment(text):\n",
253
- " text_lower=text.lower()\n",
254
- " if any(word in text_lower for word in positive_keywords):\n",
255
- " return \"positive\"\n",
256
- " elif any(word in text_lower for word in negative_keywords):\n",
257
- " return \"negative\"\n",
258
- " else:\n",
259
- " return \"neutral\"\n",
260
- "labels=[label_sentiment(sentence) for sentence in sentences]\n",
261
- "for sentence,label in zip(sentences,labels):\n",
262
- " print(f\"Sentence:'{sentence}' => Label: '{label}'\")"
263
- ]
264
- },
265
- {
266
- "cell_type": "code",
267
- "execution_count": null,
268
- "id": "b902d898-a88d-4887-9dc6-a73d7158c697",
269
- "metadata": {},
270
- "outputs": [],
271
- "source": []
272
- }
273
- ],
274
- "metadata": {
275
- "kernelspec": {
276
- "display_name": "Python 3 (ipykernel)",
277
- "language": "python",
278
- "name": "python3"
279
- },
280
- "language_info": {
281
- "codemirror_mode": {
282
- "name": "ipython",
283
- "version": 3
284
- },
285
- "file_extension": ".py",
286
- "mimetype": "text/x-python",
287
- "name": "python",
288
- "nbconvert_exporter": "python",
289
- "pygments_lexer": "ipython3",
290
- "version": "3.11.7"
291
- }
292
- },
293
- "nbformat": 4,
294
- "nbformat_minor": 5
295
- }