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,295 @@
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
+ }