noshot 0.1.7__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.
- noshot/data/ML TS XAI/ML/1. PCA - EDA/PCA-EDA.ipynb +207 -0
- noshot/data/ML TS XAI/ML/1. PCA - EDA/balance-scale.csv +626 -0
- noshot/data/ML TS XAI/ML/1. PCA - EDA/input.txt +625 -0
- noshot/data/ML TS XAI/ML/2. KNN Classifier/KNN.ipynb +287 -0
- noshot/data/ML TS XAI/ML/2. KNN Classifier/balance-scale.csv +626 -0
- noshot/data/ML TS XAI/ML/2. KNN Classifier/input.txt +625 -0
- noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/LDA.ipynb +83 -0
- noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/balance-scale.csv +626 -0
- noshot/data/ML TS XAI/ML/3. Linear Discriminant Analysis/input.txt +625 -0
- noshot/data/ML TS XAI/ML/4. Linear Regression/Linear-Regression.ipynb +117 -0
- noshot/data/ML TS XAI/ML/4. Linear Regression/machine-data.csv +210 -0
- noshot/data/ML TS XAI/ML/5. Logistic Regression/Logistic-Regression.ipynb +137 -0
- noshot/data/ML TS XAI/ML/5. Logistic Regression/wine-dataset.csv +179 -0
- noshot/data/ML TS XAI/ML/6. Bayesian Classifier/Bayesian.ipynb +129 -0
- noshot/data/ML TS XAI/ML/6. Bayesian Classifier/wine-dataset.csv +179 -0
- {noshot-0.1.7.dist-info → noshot-0.1.8.dist-info}/METADATA +2 -2
- noshot-0.1.8.dist-info/RECORD +24 -0
- noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(A) Breadth First Search.ipynb +0 -112
- noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(B) Depth First Search.ipynb +0 -111
- noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(C) Uniform Cost Search.ipynb +0 -134
- noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(D) Depth Limites Search.ipynb +0 -115
- noshot/data/ML TS XAI/AIDS/1. Implement Basic Search Strategies/(E) Iterative Deepening DFS.ipynb +0 -123
- noshot/data/ML TS XAI/AIDS/10. ANOVA/2_ANOVA.csv +0 -769
- noshot/data/ML TS XAI/AIDS/10. ANOVA/One Way ANOVA (Repeated Measure).ipynb +0 -126
- noshot/data/ML TS XAI/AIDS/10. ANOVA/One Way ANOVA.ipynb +0 -134
- noshot/data/ML TS XAI/AIDS/10. ANOVA/Sample 1 Way ANOVA Test.ipynb +0 -119
- noshot/data/ML TS XAI/AIDS/10. ANOVA/Two Way ANOVA.ipynb +0 -138
- noshot/data/ML TS XAI/AIDS/10. ANOVA/reaction_time.csv +0 -5
- noshot/data/ML TS XAI/AIDS/10. ANOVA/sample_data.csv +0 -16
- noshot/data/ML TS XAI/AIDS/10. ANOVA/sleep_deprivation.csv +0 -4
- noshot/data/ML TS XAI/AIDS/11. Linear Regression/3_Linear.csv +0 -4802
- noshot/data/ML TS XAI/AIDS/11. Linear Regression/Linear Regression LAB.ipynb +0 -113
- noshot/data/ML TS XAI/AIDS/11. Linear Regression/Linear Regression New- sklearn.ipynb +0 -118
- noshot/data/ML TS XAI/AIDS/11. Linear Regression/Linear Regression.ipynb +0 -148
- noshot/data/ML TS XAI/AIDS/11. Linear Regression/house_rate.csv +0 -22
- noshot/data/ML TS XAI/AIDS/12. Logistic Regression/Logistic Regression New- sklearn.ipynb +0 -128
- noshot/data/ML TS XAI/AIDS/12. Logistic Regression/Logistic Regression.ipynb +0 -145
- noshot/data/ML TS XAI/AIDS/12. Logistic Regression/default.csv +0 -1001
- noshot/data/ML TS XAI/AIDS/12. Logistic Regression/hours_scores_records.csv +0 -101
- noshot/data/ML TS XAI/AIDS/2. Implement A Star And MA Star/(A) Astar.ipynb +0 -256
- noshot/data/ML TS XAI/AIDS/2. Implement A Star And MA Star/(B) IDAstar.ipynb +0 -157
- noshot/data/ML TS XAI/AIDS/2. Implement A Star And MA Star/(C) SMAstar.ipynb +0 -178
- noshot/data/ML TS XAI/AIDS/3. Genetic Algorithm/Genetic.ipynb +0 -95
- noshot/data/ML TS XAI/AIDS/4. Simulated Annealing/Simulated Annealing.ipynb +0 -74
- noshot/data/ML TS XAI/AIDS/4. Simulated Annealing/Sudoku Simulated Annealing.ipynb +0 -103
- noshot/data/ML TS XAI/AIDS/5. Alpha Beta Pruning/AlphaBetaPruning.ipynb +0 -182
- noshot/data/ML TS XAI/AIDS/6. Consraint Satisfaction Problems (CSP)/(A) CSP House Allocation.ipynb +0 -120
- noshot/data/ML TS XAI/AIDS/6. Consraint Satisfaction Problems (CSP)/(B) CSP Map Coloring.ipynb +0 -125
- noshot/data/ML TS XAI/AIDS/7. Random Sampling/Random Sampling.ipynb +0 -73
- noshot/data/ML TS XAI/AIDS/7. Random Sampling/height_weight_bmi.csv +0 -8389
- noshot/data/ML TS XAI/AIDS/8. Z Test/Z Test Hash Function.ipynb +0 -141
- noshot/data/ML TS XAI/AIDS/8. Z Test/Z Test.ipynb +0 -151
- noshot/data/ML TS XAI/AIDS/8. Z Test/height_weight_bmi.csv +0 -8389
- noshot/data/ML TS XAI/AIDS/9. T Test/1_heart.csv +0 -304
- noshot/data/ML TS XAI/AIDS/9. T Test/Independent T Test.ipynb +0 -119
- noshot/data/ML TS XAI/AIDS/9. T Test/Paired T Test.ipynb +0 -118
- noshot/data/ML TS XAI/AIDS/9. T Test/T Test Hash Function.ipynb +0 -142
- noshot/data/ML TS XAI/AIDS/9. T Test/T Test.ipynb +0 -158
- noshot/data/ML TS XAI/AIDS/9. T Test/height_weight_bmi.csv +0 -8389
- noshot/data/ML TS XAI/AIDS/9. T Test/iq_test.csv +0 -0
- noshot/data/ML TS XAI/AIDS/Others (AllinOne)/All In One.ipynb +0 -4581
- noshot/data/ML TS XAI/CN/1. Chat Application/chat.java +0 -81
- noshot/data/ML TS XAI/CN/1. Chat Application/output.png +0 -0
- noshot/data/ML TS XAI/CN/1. Chat Application/procedure.png +0 -0
- noshot/data/ML TS XAI/CN/10. Ethernet LAN IEEE 802.3/LAN.tcl +0 -65
- noshot/data/ML TS XAI/CN/10. Ethernet LAN IEEE 802.3/analysis.awk +0 -44
- noshot/data/ML TS XAI/CN/10. Ethernet LAN IEEE 802.3/output.png +0 -0
- noshot/data/ML TS XAI/CN/10. Ethernet LAN IEEE 802.3/procedure.png +0 -0
- noshot/data/ML TS XAI/CN/11. Wireless LAN IEEE 802.11/complexdcf.tcl +0 -229
- noshot/data/ML TS XAI/CN/11. Wireless LAN IEEE 802.11/output.png +0 -0
- noshot/data/ML TS XAI/CN/11. Wireless LAN IEEE 802.11/procedure.png +0 -0
- noshot/data/ML TS XAI/CN/2. File Transfer/file_to_send.txt +0 -2
- noshot/data/ML TS XAI/CN/2. File Transfer/filetransfer.java +0 -119
- noshot/data/ML TS XAI/CN/2. File Transfer/output.png +0 -0
- noshot/data/ML TS XAI/CN/2. File Transfer/procedure.png +0 -0
- noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/Client.class +0 -0
- noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/MyServerImpl.class +0 -0
- noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/MyServerIntf.class +0 -0
- noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/Server.class +0 -0
- noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/output.png +0 -0
- noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/procedure.png +0 -0
- noshot/data/ML TS XAI/CN/3. RMI (Remote Method Invocation)/rmi.java +0 -56
- noshot/data/ML TS XAI/CN/4. Wired Network/output.png +0 -0
- noshot/data/ML TS XAI/CN/4. Wired Network/procedure.png +0 -0
- noshot/data/ML TS XAI/CN/4. Wired Network/wired.awk +0 -25
- noshot/data/ML TS XAI/CN/4. Wired Network/wired.tcl +0 -81
- noshot/data/ML TS XAI/CN/5. Wireless Network/output.png +0 -0
- noshot/data/ML TS XAI/CN/5. Wireless Network/procedure.png +0 -0
- noshot/data/ML TS XAI/CN/5. Wireless Network/wireless.awk +0 -27
- noshot/data/ML TS XAI/CN/5. Wireless Network/wireless.tcl +0 -153
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/analysis.awk +0 -27
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/output.png +0 -0
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/sack.tcl +0 -86
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/vegas.tcl +0 -86
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/analysis.awk +0 -28
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/output.png +0 -0
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/reno.tcl +0 -78
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/tahoe.tcl +0 -79
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Flow Control/analysis.awk +0 -27
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Flow Control/flow.tcl +0 -163
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/TCP Flow Control/output.png +0 -0
- noshot/data/ML TS XAI/CN/6. TCP Flow And Congestion Control/procedure.png +0 -0
- noshot/data/ML TS XAI/CN/7. Link State And Distance Vector Routing/DV.tcl +0 -111
- noshot/data/ML TS XAI/CN/7. Link State And Distance Vector Routing/LS.tcl +0 -106
- noshot/data/ML TS XAI/CN/7. Link State And Distance Vector Routing/analysis.awk +0 -36
- noshot/data/ML TS XAI/CN/7. Link State And Distance Vector Routing/output.png +0 -0
- noshot/data/ML TS XAI/CN/7. Link State And Distance Vector Routing/procedure.png +0 -0
- noshot/data/ML TS XAI/CN/8. Multicast And Broadcast Routing/analysis.awk +0 -20
- noshot/data/ML TS XAI/CN/8. Multicast And Broadcast Routing/broadcast.tcl +0 -76
- noshot/data/ML TS XAI/CN/8. Multicast And Broadcast Routing/multicast.tcl +0 -103
- noshot/data/ML TS XAI/CN/8. Multicast And Broadcast Routing/output.png +0 -0
- noshot/data/ML TS XAI/CN/8. Multicast And Broadcast Routing/procedure.png +0 -0
- noshot/data/ML TS XAI/CN/9. DHCP/DHCP.java +0 -125
- noshot/data/ML TS XAI/CN/9. DHCP/output.png +0 -0
- noshot/data/ML TS XAI/CN/9. DHCP/procedure.png +0 -0
- noshot/data/ML TS XAI/NLP/NLP 1/1-Prereqs.py +0 -18
- noshot/data/ML TS XAI/NLP/NLP 1/2-Chi2test.py +0 -83
- noshot/data/ML TS XAI/NLP/NLP 1/2-T-test.py +0 -79
- noshot/data/ML TS XAI/NLP/NLP 1/3-WSD-nb.py +0 -53
- noshot/data/ML TS XAI/NLP/NLP 1/4-Hindle-Rooth.py +0 -53
- noshot/data/ML TS XAI/NLP/NLP 1/5-HMM-Trellis.py +0 -82
- noshot/data/ML TS XAI/NLP/NLP 1/6-HMM-Viterbi.py +0 -16
- noshot/data/ML TS XAI/NLP/NLP 1/7-PCFG-parsetree.py +0 -15
- noshot/data/ML TS XAI/NLP/NLP 1/Chi2test.ipynb +0 -285
- noshot/data/ML TS XAI/NLP/NLP 1/Hindle-Rooth.ipynb +0 -179
- noshot/data/ML TS XAI/NLP/NLP 1/Lab 10 - Text generator using LSTM.ipynb +0 -1461
- noshot/data/ML TS XAI/NLP/NLP 1/Lab 11 NMT.ipynb +0 -2307
- noshot/data/ML TS XAI/NLP/NLP 1/PCFG.ipynb +0 -134
- noshot/data/ML TS XAI/NLP/NLP 1/Prereqs.ipynb +0 -131
- noshot/data/ML TS XAI/NLP/NLP 1/T test.ipynb +0 -252
- noshot/data/ML TS XAI/NLP/NLP 1/TFIDF BOW.ipynb +0 -171
- noshot/data/ML TS XAI/NLP/NLP 1/Trellis.ipynb +0 -244
- noshot/data/ML TS XAI/NLP/NLP 1/WSD.ipynb +0 -645
- noshot/data/ML TS XAI/NLP/NLP 1/Word2Vec.ipynb +0 -93
- noshot/data/ML TS XAI/NLP/NLP 2/Lab01(tokenizer)/tokenizer.ipynb +0 -370
- noshot/data/ML TS XAI/NLP/NLP 2/Lab01(tokenizer)/training_tokenizer.txt +0 -6
- noshot/data/ML TS XAI/NLP/NLP 2/Lab02(stemming)/exp0.ipynb +0 -274
- noshot/data/ML TS XAI/NLP/NLP 2/Lab02(stemming)/lab2.ipynb +0 -905
- noshot/data/ML TS XAI/NLP/NLP 2/Lab02(stemming)/test.txt +0 -1
- noshot/data/ML TS XAI/NLP/NLP 2/Lab02(stemming)/tokenizing.ipynb +0 -272
- noshot/data/ML TS XAI/NLP/NLP 2/Lab03(parse-tree)/collocation.ipynb +0 -332
- noshot/data/ML TS XAI/NLP/NLP 2/Lab03(parse-tree)/lab3.ipynb +0 -549
- noshot/data/ML TS XAI/NLP/NLP 2/Lab03(parse-tree)/nlp.txt +0 -1
- noshot/data/ML TS XAI/NLP/NLP 2/Lab04(collocation)/Lab4-NLP-Exp-2.ipynb +0 -817
- noshot/data/ML TS XAI/NLP/NLP 2/Lab04(collocation)/collocation.ipynb +0 -332
- noshot/data/ML TS XAI/NLP/NLP 2/Lab05(WSD)/NLP-Lab-5-Exp3.ipynb +0 -231
- noshot/data/ML TS XAI/NLP/NLP 2/Lab05(WSD)/word-sense-disambiguation.ipynb +0 -507
- noshot/data/ML TS XAI/NLP/NLP 2/Lab06(additional-exercise)/lab6.ipynb +0 -134
- noshot/data/ML TS XAI/NLP/NLP 2/Lab07(HMM,Viterbi)/NLP Exp 4.ipynb +0 -255
- noshot/data/ML TS XAI/NLP/NLP 2/Lab07(HMM,Viterbi)/NLP_Exp_5.ipynb +0 -159
- noshot/data/ML TS XAI/NLP/NLP 2/Lab08(PCFG)/PCFG.ipynb +0 -282
- noshot/data/ML TS XAI/NLP/NLP 2/Lab09-Hindle-rooth&MLP/Lab 9 - MLP classifier.ipynb +0 -670
- noshot/data/ML TS XAI/NLP/NLP 2/Lab09-Hindle-rooth&MLP/MLP-alternative-code.ipynb +0 -613
- noshot/data/ML TS XAI/NLP/NLP 2/Lab09-Hindle-rooth&MLP/hindle-rooth-algorithm.ipynb +0 -74
- noshot/data/ML TS XAI/NLP/NLP 2/Lab10(LSTM)/Lab_10_Text_generator_using_LSTM.ipynb +0 -480
- noshot/data/ML TS XAI/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/Machine-translation.ipynb +0 -445
- noshot/data/ML TS XAI/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/Viterbi-PCFG.ipynb +0 -105
- noshot/data/ML TS XAI/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/corpora_tools.py +0 -87
- noshot/data/ML TS XAI/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/data_utils.py +0 -11
- noshot/data/ML TS XAI/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/train_translator.py +0 -83
- noshot/data/ML TS XAI/NLP/NLP 2/Lab12(Information-Extraction)/Information_Extraction.ipynb +0 -201
- noshot/data/ML TS XAI/NLP/NLP 3/Backtrack-without-Verbitri.ipynb +0 -185
- noshot/data/ML TS XAI/NLP/NLP 3/Backward-Procedure.ipynb +0 -597
- noshot/data/ML TS XAI/NLP/NLP 3/Bag_of.ipynb +0 -1422
- noshot/data/ML TS XAI/NLP/NLP 3/CYK-algorithm.ipynb +0 -1067
- noshot/data/ML TS XAI/NLP/NLP 3/Forward-Procedure.ipynb +0 -477
- noshot/data/ML TS XAI/NLP/NLP 3/LSTM.ipynb +0 -1290
- noshot/data/ML TS XAI/NLP/NLP 3/Lab 10 - Text generator using LSTM.ipynb +0 -1461
- noshot/data/ML TS XAI/NLP/NLP 3/Lab 11 NMT.ipynb +0 -2307
- noshot/data/ML TS XAI/NLP/NLP 3/NLP-LAB-4.ipynb +0 -216
- noshot/data/ML TS XAI/NLP/NLP 3/NLP-LAB-5.ipynb +0 -216
- noshot/data/ML TS XAI/NLP/NLP 3/abc.txt +0 -6
- noshot/data/ML TS XAI/NLP/NLP 3/ex-1-nltk.ipynb +0 -711
- noshot/data/ML TS XAI/NLP/NLP 3/ex-2-nlp.ipynb +0 -267
- noshot/data/ML TS XAI/NLP/NLP 3/exp8&9.ipynb +0 -305
- noshot/data/ML TS XAI/NLP/NLP 3/hind.ipynb +0 -287
- noshot/data/ML TS XAI/NLP/NLP 3/lab66.ipynb +0 -752
- noshot/data/ML TS XAI/NLP/NLP 3/leb_3.ipynb +0 -612
- noshot/data/ML TS XAI/NLP/NLP 3/naive_bayes_classifier.pkl +0 -0
- noshot/data/ML TS XAI/NLP/NLP 3/nlp_leb_1.ipynb +0 -3008
- noshot/data/ML TS XAI/NLP/NLP 3/nlp_leb_2.ipynb +0 -3095
- noshot/data/ML TS XAI/NLP/NLP 3/nlplab-9.ipynb +0 -295
- noshot/data/ML TS XAI/NLP/NLP 3/nltk-ex-4.ipynb +0 -506
- noshot/data/ML TS XAI/NLP/NLP 3/text1.txt +0 -48
- noshot/data/ML TS XAI/NLP/NLP 3/text2.txt +0 -8
- noshot/data/ML TS XAI/NLP/NLP 3/text3.txt +0 -48
- noshot/data/ML TS XAI/NLP/NLP 3/translation-rnn.ipynb +0 -812
- noshot/data/ML TS XAI/NLP/NLP 3/word2vector.ipynb +0 -173
- noshot/data/ML TS XAI/NLP/NLP 4/Backward Procedure Algorithm.ipynb +0 -179
- noshot/data/ML TS XAI/NLP/NLP 4/Chi Square Collocation.ipynb +0 -208
- noshot/data/ML TS XAI/NLP/NLP 4/Collocation (T test).ipynb +0 -188
- noshot/data/ML TS XAI/NLP/NLP 4/Experiment 1.ipynb +0 -437
- noshot/data/ML TS XAI/NLP/NLP 4/Forward Procedure Algorithm.ipynb +0 -132
- noshot/data/ML TS XAI/NLP/NLP 4/Hindle Rooth.ipynb +0 -414
- noshot/data/ML TS XAI/NLP/NLP 4/MachineTranslation.ipynb +0 -368
- noshot/data/ML TS XAI/NLP/NLP 4/Multi Layer Perceptron using MLPClassifier.ipynb +0 -86
- noshot/data/ML TS XAI/NLP/NLP 4/Multi Layer Perceptron using Tensorflow.ipynb +0 -112
- noshot/data/ML TS XAI/NLP/NLP 4/PCFG Inside Probability.ipynb +0 -451
- noshot/data/ML TS XAI/NLP/NLP 4/Text Generation using LSTM.ipynb +0 -297
- noshot/data/ML TS XAI/NLP/NLP 4/Viterbi.ipynb +0 -310
- noshot/data/ML TS XAI/NLP/NLP 4/Word Sense Disambiguation.ipynb +0 -335
- noshot/data/ML TS XAI/NLP/NLP 5/10.Text Generation using LSTM.ipynb +0 -316
- noshot/data/ML TS XAI/NLP/NLP 5/11.Machine Translation.ipynb +0 -868
- noshot/data/ML TS XAI/NLP/NLP 5/2.T and Chi2 Test.ipynb +0 -204
- noshot/data/ML TS XAI/NLP/NLP 5/3.Word Sense Diambiguation.ipynb +0 -234
- noshot/data/ML TS XAI/NLP/NLP 5/4.Hinddle and Rooth.ipynb +0 -128
- noshot/data/ML TS XAI/NLP/NLP 5/5.Forward and Backward.ipynb +0 -149
- noshot/data/ML TS XAI/NLP/NLP 5/6.Viterbi.ipynb +0 -111
- noshot/data/ML TS XAI/NLP/NLP 5/7.PCFG Parse Tree.ipynb +0 -134
- noshot/data/ML TS XAI/NLP/NLP 5/7.PCFG using cyk.ipynb +0 -101
- noshot/data/ML TS XAI/NLP/NLP 5/8.Bag of words and TF-IDF.ipynb +0 -310
- noshot/data/ML TS XAI/NLP/NLP 5/9.Word2Vector.ipynb +0 -78
- noshot/data/ML TS XAI/NLP/NLP 5/NLP ALL In One.ipynb +0 -2619
- noshot/data/ML TS XAI/NLP/NLP 5/sample1.txt +0 -15
- noshot/data/ML TS XAI/NLP/NLP 5/sample2.txt +0 -4
- noshot/data/ML TS XAI/NLP/NLP 5/word2vec_model.bin +0 -0
- noshot/data/ML TS XAI/NLP/NLP 6/1. Tokenize, Tagging, NER, Parse Tree.ipynb +0 -312
- noshot/data/ML TS XAI/NLP/NLP 6/2. T Test and Chi2 Test.ipynb +0 -185
- noshot/data/ML TS XAI/NLP/NLP 6/3. Naive Bayes WSD.ipynb +0 -199
- noshot/data/ML TS XAI/NLP/NLP 6/4. Hinddle and Rooth.ipynb +0 -151
- noshot/data/ML TS XAI/NLP/NLP 6/5 and 6 FWD, BWD, Viterbi.ipynb +0 -164
- noshot/data/ML TS XAI/NLP/NLP 6/7. PCFG using CYK.ipynb +0 -383
- noshot/data/ML TS XAI/NLP/NLP 6/8. BOW and TF-IDF.ipynb +0 -252
- noshot/data/ML TS XAI/Ubuntu CN Lab.iso +0 -0
- noshot-0.1.7.dist-info/RECORD +0 -216
- {noshot-0.1.7.dist-info → noshot-0.1.8.dist-info}/LICENSE.txt +0 -0
- {noshot-0.1.7.dist-info → noshot-0.1.8.dist-info}/WHEEL +0 -0
- {noshot-0.1.7.dist-info → noshot-0.1.8.dist-info}/top_level.txt +0 -0
@@ -1,15 +0,0 @@
|
|
1
|
-
### The Impact of Social Media on Modern Communication
|
2
|
-
|
3
|
-
In the digital age, social media has revolutionized the way people communicate, offering unprecedented access to information and creating new ways to interact. Platforms like Facebook, Twitter, Instagram, and TikTok have connected individuals from across the globe, allowing for the instant exchange of ideas, images, and experiences. However, the rise of social media has also raised significant concerns about its impact on human relationships, mental health, and societal dynamics. This essay explores the positive and negative effects of social media on modern communication.
|
4
|
-
|
5
|
-
On the positive side, social media has made communication more convenient and accessible than ever before. In the past, staying in touch with friends and family required physical mail, phone calls, or face-to-face interactions. Now, platforms like Facebook and WhatsApp allow people to send messages, share updates, and make video calls at any time, from anywhere in the world. This has facilitated long-distance relationships, strengthened bonds among friends and family, and made it easier to stay connected with people who may otherwise be difficult to reach.
|
6
|
-
|
7
|
-
Moreover, social media has democratized communication, allowing individuals to express their opinions and ideas to a global audience. This has had a profound effect on activism and social movements. For example, platforms like Twitter and Instagram have played crucial roles in raising awareness about issues such as climate change, racial injustice, and political corruption. Activists can mobilize support, organize protests, and share important information in real time. The viral nature of social media also means that messages can reach millions of people in a matter of hours, making it an invaluable tool for social change.
|
8
|
-
|
9
|
-
However, social media's influence is not entirely positive. One of the primary concerns is the effect it has on face-to-face communication skills. As people spend more time interacting online, they may become less adept at having meaningful in-person conversations. Social media interactions tend to be more superficial, with users often relying on emojis, likes, or short messages rather than engaging in deep, thoughtful discussions. This can result in a decline in the quality of personal relationships, as online communication often lacks the nuances and emotional depth found in face-to-face conversations.
|
10
|
-
|
11
|
-
Another issue is the impact of social media on mental health. Studies have shown that excessive use of platforms like Instagram and Facebook can lead to feelings of isolation, anxiety, and depression. Constant comparison to others, especially when viewing curated, idealized images of other people's lives, can lead to low self-esteem and body image issues. The pressure to present a perfect life online, coupled with the fear of missing out (FOMO), can also contribute to heightened stress and dissatisfaction. Additionally, cyberbullying and online harassment have become increasingly prevalent, leading to harmful consequences for individuals, particularly teenagers.
|
12
|
-
|
13
|
-
Furthermore, social media can exacerbate the spread of misinformation. Fake news, conspiracy theories, and misleading content can spread rapidly across platforms, influencing public opinion and distorting perceptions of reality. The algorithms that govern social media platforms often prioritize content that generates engagement, meaning sensational or controversial material is more likely to be shared and seen by a wide audience. This can create echo chambers where individuals are exposed only to information that confirms their existing beliefs, reinforcing polarization and division in society.
|
14
|
-
|
15
|
-
In conclusion, social media has undeniably transformed modern communication, making it easier to connect with others and share information on a global scale. However, its impact on face-to-face interactions, mental health, and the spread of misinformation presents significant challenges. As social media continues to evolve, it is crucial that users and society as a whole strike a balance, using these platforms in ways that enhance communication while minimizing their negative effects.
|
Binary file
|
@@ -1,312 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "markdown",
|
5
|
-
"id": "1a144d85-fe3b-4392-854b-f194b5583f23",
|
6
|
-
"metadata": {},
|
7
|
-
"source": [
|
8
|
-
"# Experiment 1 :\n",
|
9
|
-
"<b>Perform the following task using NLTK: Tokenize and tag some text, identify named entities, display a parse tree and find the ambiguity of the sentence using parse tree</b>"
|
10
|
-
]
|
11
|
-
},
|
12
|
-
{
|
13
|
-
"cell_type": "code",
|
14
|
-
"execution_count": 1,
|
15
|
-
"id": "46410704-680c-4baa-b3d4-33645fa19ddb",
|
16
|
-
"metadata": {},
|
17
|
-
"outputs": [
|
18
|
-
{
|
19
|
-
"name": "stdout",
|
20
|
-
"output_type": "stream",
|
21
|
-
"text": [
|
22
|
-
"--------------------------------------------------\n",
|
23
|
-
"TOKENIZED SENTENCES\n",
|
24
|
-
"--------------------------------------------------\n",
|
25
|
-
"1. [Emma by Jane Austen 1816] VOLUME I CHAPTER I Emma Woodhouse, handsome, clever, and rich, with a comfortable home and happy disposition, seemed to unite some of the best blessings of existence; and had lived nearly twenty-one years in the world with very little to distress or vex her.\n",
|
26
|
-
"2. She was the youngest of the two daughters of a most affectionate, indulgent father; and had, in consequence of her sister's marriage, been mistress of his house from a very early period.\n",
|
27
|
-
"3. Her mother had died too long ago for her to have more than an indistinct remembrance of her caresses; and her place had been supplied by an excellent woman as governess, who had fallen little short of a mother in affection.\n",
|
28
|
-
"4. Sixteen years had Miss Taylor been in Mr. Woodhouse's family, less as a governess than a friend, very fond of both daughters, but particularly of Emma.\n",
|
29
|
-
"5. Between _them_ it was more the intimacy of sisters.\n",
|
30
|
-
"6. Even before Miss Taylor had ceased to hold the nominal office of governess, the mildness\n",
|
31
|
-
"\n",
|
32
|
-
"--------------------------------------------------\n",
|
33
|
-
"TOKENIZED WORDS\n",
|
34
|
-
"--------------------------------------------------\n",
|
35
|
-
"['Emma', 'by', 'Jane', 'Austen', '1816', 'VOLUME', 'I', 'CHAPTER', 'I', 'Emma', 'Woodhouse', 'handsome', 'clever', 'and', 'rich', 'with', 'a', 'comfortable', 'home', 'and', 'happy', 'disposition', 'seemed', 'to', 'unite', 'some', 'of', 'the', 'best', 'blessings', 'of', 'existence', 'and', 'had', 'lived', 'nearly', 'twentyone', 'years', 'in', 'the', 'world', 'with', 'very', 'little', 'to', 'distress', 'or', 'vex', 'her']\n",
|
36
|
-
"['She', 'was', 'the', 'youngest', 'of', 'the', 'two', 'daughters', 'of', 'a', 'most', 'affectionate', 'indulgent', 'father', 'and', 'had', 'in', 'consequence', 'of', 'her', 'sisters', 'marriage', 'been', 'mistress', 'of', 'his', 'house', 'from', 'a', 'very', 'early', 'period']\n",
|
37
|
-
"['Her', 'mother', 'had', 'died', 'too', 'long', 'ago', 'for', 'her', 'to', 'have', 'more', 'than', 'an', 'indistinct', 'remembrance', 'of', 'her', 'caresses', 'and', 'her', 'place', 'had', 'been', 'supplied', 'by', 'an', 'excellent', 'woman', 'as', 'governess', 'who', 'had', 'fallen', 'little', 'short', 'of', 'a', 'mother', 'in', 'affection']\n",
|
38
|
-
"['Sixteen', 'years', 'had', 'Miss', 'Taylor', 'been', 'in', 'Mr', 'Woodhouses', 'family', 'less', 'as', 'a', 'governess', 'than', 'a', 'friend', 'very', 'fond', 'of', 'both', 'daughters', 'but', 'particularly', 'of', 'Emma']\n",
|
39
|
-
"['Between', 'them', 'it', 'was', 'more', 'the', 'intimacy', 'of', 'sisters']\n",
|
40
|
-
"['Even', 'before', 'Miss', 'Taylor', 'had', 'ceased', 'to', 'hold', 'the', 'nominal', 'office', 'of', 'governess', 'the', 'mildness']\n",
|
41
|
-
"\n",
|
42
|
-
"--------------------------------------------------\n",
|
43
|
-
"SENTENCES WITHOUT STOPWORDS\n",
|
44
|
-
"--------------------------------------------------\n",
|
45
|
-
"1. Emma Jane Austen 1816 VOLUME CHAPTER Emma Woodhouse handsome clever rich comfortable home happy disposition seemed unite best blessings existence lived nearly twentyone years world little distress vex\n",
|
46
|
-
"2. youngest two daughters affectionate indulgent father consequence sisters marriage mistress house early period\n",
|
47
|
-
"3. mother died long ago indistinct remembrance caresses place supplied excellent woman governess fallen little short mother affection\n",
|
48
|
-
"4. Sixteen years Miss Taylor Mr Woodhouses family less governess friend fond daughters particularly Emma\n",
|
49
|
-
"5. intimacy sisters\n",
|
50
|
-
"6. Even Miss Taylor ceased hold nominal office governess mildness\n",
|
51
|
-
"\n",
|
52
|
-
"--------------------------------------------------\n",
|
53
|
-
"SENTENCES AFTER STEMMING\n",
|
54
|
-
"--------------------------------------------------\n",
|
55
|
-
"1. emma by jane austen 1816 volum i chapter i emma woodhous handsom clever and rich with a comfort home and happi disposit seem to unit some of the best bless of exist and had live nearli twentyon year in the world with veri littl to distress or vex her\n",
|
56
|
-
"2. she wa the youngest of the two daughter of a most affection indulg father and had in consequ of her sister marriag been mistress of hi hous from a veri earli period\n",
|
57
|
-
"3. her mother had die too long ago for her to have more than an indistinct remembr of her caress and her place had been suppli by an excel woman as gover who had fallen littl short of a mother in affect\n",
|
58
|
-
"4. sixteen year had miss taylor been in mr woodhous famili less as a gover than a friend veri fond of both daughter but particularli of emma\n",
|
59
|
-
"5. between them it wa more the intimaci of sister\n",
|
60
|
-
"6. even befor miss taylor had ceas to hold the nomin offic of gover the mild\n",
|
61
|
-
"\n",
|
62
|
-
"--------------------------------------------------\n",
|
63
|
-
"SENTENCES AFTER LEMMATIZATION\n",
|
64
|
-
"--------------------------------------------------\n",
|
65
|
-
"1. Emma by Jane Austen 1816 VOLUME I CHAPTER I Emma Woodhouse handsome clever and rich with a comfortable home and happy disposition seemed to unite some of the best blessing of existence and had lived nearly twentyone year in the world with very little to distress or vex her\n",
|
66
|
-
"2. She wa the youngest of the two daughter of a most affectionate indulgent father and had in consequence of her sister marriage been mistress of his house from a very early period\n",
|
67
|
-
"3. Her mother had died too long ago for her to have more than an indistinct remembrance of her caress and her place had been supplied by an excellent woman a governess who had fallen little short of a mother in affection\n",
|
68
|
-
"4. Sixteen year had Miss Taylor been in Mr Woodhouses family le a a governess than a friend very fond of both daughter but particularly of Emma\n",
|
69
|
-
"5. Between them it wa more the intimacy of sister\n",
|
70
|
-
"6. Even before Miss Taylor had ceased to hold the nominal office of governess the mildness\n"
|
71
|
-
]
|
72
|
-
}
|
73
|
-
],
|
74
|
-
"source": [
|
75
|
-
"import nltk\n",
|
76
|
-
"from nltk import sent_tokenize, word_tokenize, pos_tag, ne_chunk\n",
|
77
|
-
"from nltk.corpus import gutenberg, stopwords\n",
|
78
|
-
"from nltk.stem import PorterStemmer, WordNetLemmatizer\n",
|
79
|
-
"from nltk.tree import Tree\n",
|
80
|
-
"from nltk.parse import RecursiveDescentParser\n",
|
81
|
-
"import string\n",
|
82
|
-
"\n",
|
83
|
-
"sentences = gutenberg.raw('austen-emma.txt')[:999]\n",
|
84
|
-
"\n",
|
85
|
-
"#Tokenization : using nltk.sent_tokenize, nltk.word_tokenize\n",
|
86
|
-
"sent_tokens = sent_tokenize(sentences)\n",
|
87
|
-
"print('-'*50 + \"\\nTOKENIZED SENTENCES\\n\" + '-'*50)\n",
|
88
|
-
"for i, sentence in enumerate(sent_tokens) :\n",
|
89
|
-
" sentence = sentence.replace('\\n', ' ')\n",
|
90
|
-
" print(rf\"{i+1}. {sentence}\")\n",
|
91
|
-
"\n",
|
92
|
-
"word_tokens = []; print()\n",
|
93
|
-
"print('-'*50 + \"\\nTOKENIZED WORDS\\n\" + '-'*50)\n",
|
94
|
-
"for sentence in sent_tokens :\n",
|
95
|
-
" translator = str.maketrans('', '', string.punctuation)\n",
|
96
|
-
" sentence = sentence.translate(translator)\n",
|
97
|
-
" word_tokens.append(word_tokenize(sentence))\n",
|
98
|
-
" print(word_tokens[-1], end = '\\n')\n",
|
99
|
-
"\n",
|
100
|
-
"#Removal of stopwords : using nltk.corpus.stopwords\n",
|
101
|
-
"stops = set(stopwords.words('english')); print()\n",
|
102
|
-
"print('-'*50 + \"\\nSENTENCES WITHOUT STOPWORDS\\n\" + '-'*50)\n",
|
103
|
-
"for i, tokens in enumerate(word_tokens) :\n",
|
104
|
-
" sentence = ' '.join(word for word in tokens if word.lower() not in stops)\n",
|
105
|
-
" print(rf\"{i+1}. {sentence}\")\n",
|
106
|
-
"\n",
|
107
|
-
"#Stemming : using nltk.stem.PorterStemmer\n",
|
108
|
-
"stemmer = PorterStemmer(); print()\n",
|
109
|
-
"print('-'*50 + \"\\nSENTENCES AFTER STEMMING\\n\" + '-'*50)\n",
|
110
|
-
"for i, tokens in enumerate(word_tokens) :\n",
|
111
|
-
" sentence = ' '.join(stemmer.stem(word) for word in tokens)\n",
|
112
|
-
" print(rf\"{i+1}. {sentence}\")\n",
|
113
|
-
"\n",
|
114
|
-
"#Lemmatization : using nltk.stem.WordNetLemmatizer\n",
|
115
|
-
"lemmatizer = WordNetLemmatizer(); print()\n",
|
116
|
-
"print('-'*50 + \"\\nSENTENCES AFTER LEMMATIZATION\\n\" + '-'*50)\n",
|
117
|
-
"for i, tokens in enumerate(word_tokens) :\n",
|
118
|
-
" sentence = ' '.join(lemmatizer.lemmatize(word) for word in tokens)\n",
|
119
|
-
" print(rf\"{i+1}. {sentence}\")\n"
|
120
|
-
]
|
121
|
-
},
|
122
|
-
{
|
123
|
-
"cell_type": "code",
|
124
|
-
"execution_count": 2,
|
125
|
-
"id": "a8f0edc0-167d-4c7a-bbce-530c5a146861",
|
126
|
-
"metadata": {},
|
127
|
-
"outputs": [
|
128
|
-
{
|
129
|
-
"name": "stdout",
|
130
|
-
"output_type": "stream",
|
131
|
-
"text": [
|
132
|
-
"--------------------------------------------------\n",
|
133
|
-
"TAGGED TOKENS\n",
|
134
|
-
"--------------------------------------------------\n",
|
135
|
-
"1. [('Emma', 'NN'), ('by', 'IN'), ('Jane', 'NNP'), ('Austen', 'NNP'), ('1816', 'CD'), ('VOLUME', 'NNP'), ('I', 'PRP'), ('CHAPTER', 'VBP'), ('I', 'PRP'), ('Emma', 'NNP'), ('Woodhouse', 'NNP'), ('handsome', 'VBD'), ('clever', 'NN'), ('and', 'CC'), ('rich', 'JJ'), ('with', 'IN'), ('a', 'DT'), ('comfortable', 'JJ'), ('home', 'NN'), ('and', 'CC'), ('happy', 'JJ'), ('disposition', 'NN'), ('seemed', 'VBD'), ('to', 'TO'), ('unite', 'VB'), ('some', 'DT'), ('of', 'IN'), ('the', 'DT'), ('best', 'JJS'), ('blessings', 'NNS'), ('of', 'IN'), ('existence', 'NN'), ('and', 'CC'), ('had', 'VBD'), ('lived', 'VBN'), ('nearly', 'RB'), ('twentyone', 'CD'), ('years', 'NNS'), ('in', 'IN'), ('the', 'DT'), ('world', 'NN'), ('with', 'IN'), ('very', 'RB'), ('little', 'JJ'), ('to', 'TO'), ('distress', 'VB'), ('or', 'CC'), ('vex', 'VB'), ('her', 'PRP$')]\n",
|
136
|
-
"\n",
|
137
|
-
"2. [('She', 'PRP'), ('was', 'VBD'), ('the', 'DT'), ('youngest', 'JJS'), ('of', 'IN'), ('the', 'DT'), ('two', 'CD'), ('daughters', 'NNS'), ('of', 'IN'), ('a', 'DT'), ('most', 'RBS'), ('affectionate', 'JJ'), ('indulgent', 'NN'), ('father', 'NN'), ('and', 'CC'), ('had', 'VBD'), ('in', 'IN'), ('consequence', 'NN'), ('of', 'IN'), ('her', 'PRP$'), ('sisters', 'NNS'), ('marriage', 'VBP'), ('been', 'VBN'), ('mistress', 'NN'), ('of', 'IN'), ('his', 'PRP$'), ('house', 'NN'), ('from', 'IN'), ('a', 'DT'), ('very', 'RB'), ('early', 'JJ'), ('period', 'NN')]\n",
|
138
|
-
"\n",
|
139
|
-
"3. [('Her', 'PRP$'), ('mother', 'NN'), ('had', 'VBD'), ('died', 'VBN'), ('too', 'RB'), ('long', 'RB'), ('ago', 'RB'), ('for', 'IN'), ('her', 'PRP$'), ('to', 'TO'), ('have', 'VB'), ('more', 'JJR'), ('than', 'IN'), ('an', 'DT'), ('indistinct', 'JJ'), ('remembrance', 'NN'), ('of', 'IN'), ('her', 'PRP$'), ('caresses', 'NNS'), ('and', 'CC'), ('her', 'PRP$'), ('place', 'NN'), ('had', 'VBD'), ('been', 'VBN'), ('supplied', 'VBN'), ('by', 'IN'), ('an', 'DT'), ('excellent', 'JJ'), ('woman', 'NN'), ('as', 'IN'), ('governess', 'NN'), ('who', 'WP'), ('had', 'VBD'), ('fallen', 'VBN'), ('little', 'JJ'), ('short', 'JJ'), ('of', 'IN'), ('a', 'DT'), ('mother', 'NN'), ('in', 'IN'), ('affection', 'NN')]\n",
|
140
|
-
"\n",
|
141
|
-
"4. [('Sixteen', 'JJ'), ('years', 'NNS'), ('had', 'VBD'), ('Miss', 'NNP'), ('Taylor', 'NNP'), ('been', 'VBN'), ('in', 'IN'), ('Mr', 'NNP'), ('Woodhouses', 'NNP'), ('family', 'NN'), ('less', 'CC'), ('as', 'IN'), ('a', 'DT'), ('governess', 'NN'), ('than', 'IN'), ('a', 'DT'), ('friend', 'JJ'), ('very', 'RB'), ('fond', 'NN'), ('of', 'IN'), ('both', 'DT'), ('daughters', 'NNS'), ('but', 'CC'), ('particularly', 'RB'), ('of', 'IN'), ('Emma', 'NNP')]\n",
|
142
|
-
"\n",
|
143
|
-
"5. [('Between', 'IN'), ('them', 'PRP'), ('it', 'PRP'), ('was', 'VBD'), ('more', 'RBR'), ('the', 'DT'), ('intimacy', 'NN'), ('of', 'IN'), ('sisters', 'NNS')]\n",
|
144
|
-
"\n",
|
145
|
-
"6. [('Even', 'RB'), ('before', 'IN'), ('Miss', 'NNP'), ('Taylor', 'NNP'), ('had', 'VBD'), ('ceased', 'VBN'), ('to', 'TO'), ('hold', 'VB'), ('the', 'DT'), ('nominal', 'JJ'), ('office', 'NN'), ('of', 'IN'), ('governess', 'NN'), ('the', 'DT'), ('mildness', 'NN')]\n",
|
146
|
-
"\n"
|
147
|
-
]
|
148
|
-
}
|
149
|
-
],
|
150
|
-
"source": [
|
151
|
-
"#Tagging tokens with its parts of speech: using nltk.pos_tag\n",
|
152
|
-
"print('-'*50 + \"\\nTAGGED TOKENS\\n\" + '-'*50)\n",
|
153
|
-
"tags = []\n",
|
154
|
-
"for i, tokens in enumerate(word_tokens) :\n",
|
155
|
-
" tags += [pos_tag(tokens)] \n",
|
156
|
-
" print(f\"{i+1}. {tags[-1]}\\n\")"
|
157
|
-
]
|
158
|
-
},
|
159
|
-
{
|
160
|
-
"cell_type": "code",
|
161
|
-
"execution_count": 3,
|
162
|
-
"id": "d97e2c48-7b41-4b09-a429-6f81dd2644f8",
|
163
|
-
"metadata": {},
|
164
|
-
"outputs": [
|
165
|
-
{
|
166
|
-
"name": "stdout",
|
167
|
-
"output_type": "stream",
|
168
|
-
"text": [
|
169
|
-
"--------------------------------------------------\n",
|
170
|
-
"NAMED ENTITIES\n",
|
171
|
-
"--------------------------------------------------\n",
|
172
|
-
"ENTITY : Emma, LABEL : GPE\n",
|
173
|
-
"ENTITY : Jane Austen, LABEL : PERSON\n",
|
174
|
-
"ENTITY : Emma Woodhouse, LABEL : PERSON\n",
|
175
|
-
"ENTITY : Miss Taylor, LABEL : PERSON\n",
|
176
|
-
"ENTITY : Emma, LABEL : GPE\n",
|
177
|
-
"ENTITY : Miss Taylor, LABEL : PERSON\n"
|
178
|
-
]
|
179
|
-
}
|
180
|
-
],
|
181
|
-
"source": [
|
182
|
-
"#Named entities recogonization : using nltk.ne_chunk\n",
|
183
|
-
"print('-'*50 + \"\\nNAMED ENTITIES\\n\" + '-'*50)\n",
|
184
|
-
"ne = []\n",
|
185
|
-
"for i, tag in enumerate(tags) :\n",
|
186
|
-
" ne += [ne_chunk(tag)] \n",
|
187
|
-
" for subtree in ne[-1] :\n",
|
188
|
-
" if isinstance(subtree, Tree) :\n",
|
189
|
-
" words = [word for word,tag in subtree.leaves()]\n",
|
190
|
-
" label = subtree.label()\n",
|
191
|
-
" print(f\"ENTITY : {' '.join(words)}, LABEL : {label}\")\n",
|
192
|
-
" "
|
193
|
-
]
|
194
|
-
},
|
195
|
-
{
|
196
|
-
"cell_type": "code",
|
197
|
-
"execution_count": 4,
|
198
|
-
"id": "21223618-2544-42ca-b6b5-61ad138b7d3c",
|
199
|
-
"metadata": {},
|
200
|
-
"outputs": [],
|
201
|
-
"source": [
|
202
|
-
"#To extract the list of all tags in nltk\n",
|
203
|
-
"# tagdict = nltk.data.load('help/tagsets/upenn_tagset.pickle')"
|
204
|
-
]
|
205
|
-
},
|
206
|
-
{
|
207
|
-
"cell_type": "code",
|
208
|
-
"execution_count": 3,
|
209
|
-
"id": "b5849635-4186-40d4-95d6-539226f04fb5",
|
210
|
-
"metadata": {},
|
211
|
-
"outputs": [],
|
212
|
-
"source": [
|
213
|
-
"import nltk\n",
|
214
|
-
"from nltk import word_tokenize\n",
|
215
|
-
"from nltk.parse import RecursiveDescentParser"
|
216
|
-
]
|
217
|
-
},
|
218
|
-
{
|
219
|
-
"cell_type": "code",
|
220
|
-
"execution_count": 4,
|
221
|
-
"id": "5cc00f51-fb75-49f2-ab56-b01503e2eef2",
|
222
|
-
"metadata": {},
|
223
|
-
"outputs": [
|
224
|
-
{
|
225
|
-
"name": "stdout",
|
226
|
-
"output_type": "stream",
|
227
|
-
"text": [
|
228
|
-
"PARSE TREES : \n",
|
229
|
-
" S \n",
|
230
|
-
" ________________|_______ \n",
|
231
|
-
" | VP \n",
|
232
|
-
" | ___________|_________ \n",
|
233
|
-
" | | | PP \n",
|
234
|
-
" | | | ____|___ \n",
|
235
|
-
" NP | NP | NP \n",
|
236
|
-
" ___|_____ | ___|___ | ___|____ \n",
|
237
|
-
" AT NNS V AT NN IN AT NN \n",
|
238
|
-
" | | | | | | | | \n",
|
239
|
-
"The children ate the cake with a spoon\n",
|
240
|
-
"\n",
|
241
|
-
" S \n",
|
242
|
-
" ________________|___ \n",
|
243
|
-
" | VP \n",
|
244
|
-
" | _______|____ \n",
|
245
|
-
" | | NP \n",
|
246
|
-
" | | ________|____ \n",
|
247
|
-
" | | | | PP \n",
|
248
|
-
" | | | | ____|___ \n",
|
249
|
-
" NP | | | | NP \n",
|
250
|
-
" ___|_____ | | | | ___|____ \n",
|
251
|
-
" AT NNS V AT NN IN AT NN \n",
|
252
|
-
" | | | | | | | | \n",
|
253
|
-
"The children ate the cake with a spoon\n",
|
254
|
-
"\n"
|
255
|
-
]
|
256
|
-
}
|
257
|
-
],
|
258
|
-
"source": [
|
259
|
-
"#Displaying a ParseTree and finding the ambiguity of a given sentence\n",
|
260
|
-
"grammar = nltk.CFG.fromstring(\"\"\"\n",
|
261
|
-
" S -> NP VP\n",
|
262
|
-
" NP -> AT NNS | AT NN | AT NNS PP | AT NN PP\n",
|
263
|
-
" VP -> V NP PP | V NP\n",
|
264
|
-
" PP -> IN NP\n",
|
265
|
-
" AT -> \"The\" | \"the\" | \"a\"\n",
|
266
|
-
" NNS -> \"children\"\n",
|
267
|
-
" V -> \"ate\"\n",
|
268
|
-
" NN -> \"cake\" | \"spoon\"\n",
|
269
|
-
" IN -> \"with\"\n",
|
270
|
-
"\"\"\")\n",
|
271
|
-
"\n",
|
272
|
-
"#parser = RecursiveDescentParser(grammar) #Can use nltk.ChartParser too\n",
|
273
|
-
"parser = RecursiveDescentParser(grammer)\n",
|
274
|
-
"print(\"PARSE TREES : \")\n",
|
275
|
-
"\n",
|
276
|
-
"tokens = word_tokenize(\"The children ate the cake with a spoon\")\n",
|
277
|
-
"\n",
|
278
|
-
"for tree in parser.parse(tokens) :\n",
|
279
|
-
" tree.pretty_print()"
|
280
|
-
]
|
281
|
-
},
|
282
|
-
{
|
283
|
-
"cell_type": "code",
|
284
|
-
"execution_count": null,
|
285
|
-
"id": "092acc71-a390-4f6b-a6f7-c2e3fe2a82d5",
|
286
|
-
"metadata": {},
|
287
|
-
"outputs": [],
|
288
|
-
"source": []
|
289
|
-
}
|
290
|
-
],
|
291
|
-
"metadata": {
|
292
|
-
"kernelspec": {
|
293
|
-
"display_name": "Python 3 (ipykernel)",
|
294
|
-
"language": "python",
|
295
|
-
"name": "python3"
|
296
|
-
},
|
297
|
-
"language_info": {
|
298
|
-
"codemirror_mode": {
|
299
|
-
"name": "ipython",
|
300
|
-
"version": 3
|
301
|
-
},
|
302
|
-
"file_extension": ".py",
|
303
|
-
"mimetype": "text/x-python",
|
304
|
-
"name": "python",
|
305
|
-
"nbconvert_exporter": "python",
|
306
|
-
"pygments_lexer": "ipython3",
|
307
|
-
"version": "3.12.4"
|
308
|
-
}
|
309
|
-
},
|
310
|
-
"nbformat": 4,
|
311
|
-
"nbformat_minor": 5
|
312
|
-
}
|
@@ -1,185 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "markdown",
|
5
|
-
"id": "9b7114df-da26-4d09-8d80-d7f2f6e929e2",
|
6
|
-
"metadata": {},
|
7
|
-
"source": [
|
8
|
-
"# Experiment 2 :\n",
|
9
|
-
"<b>Perform t-Test and Chi-Square test to check whether a given sequence of words is a\r\n",
|
10
|
-
"collocation or not.</b>"
|
11
|
-
]
|
12
|
-
},
|
13
|
-
{
|
14
|
-
"cell_type": "code",
|
15
|
-
"execution_count": null,
|
16
|
-
"id": "0ce25ae9-d862-4999-a198-0681b3aad9e7",
|
17
|
-
"metadata": {},
|
18
|
-
"outputs": [],
|
19
|
-
"source": [
|
20
|
-
"import nltk\n",
|
21
|
-
"from nltk import word_tokenize, sent_tokenize\n",
|
22
|
-
"from nltk.corpus import gutenberg, stopwords\n",
|
23
|
-
"import string\n",
|
24
|
-
"\n",
|
25
|
-
"data = gutenberg.raw('austen-emma.txt')\n",
|
26
|
-
"\n",
|
27
|
-
"#PREPROCESSING THE GIVEN DATA\n",
|
28
|
-
"\n",
|
29
|
-
"#Tokenization, stopwords removal\n",
|
30
|
-
"sent_tokens = sent_tokenize(data)\n",
|
31
|
-
"word_tokens = []\n",
|
32
|
-
"for sentence in sent_tokens :\n",
|
33
|
-
" sentence = sentence.translate(str.maketrans('', '', string.punctuation))\n",
|
34
|
-
" word_tokens += word_tokenize(sentence)\n",
|
35
|
-
"stops = set(stopwords.words('english'))\n",
|
36
|
-
"word_tokens = [word for word in word_tokens if word.lower() not in stops]\n",
|
37
|
-
"\n",
|
38
|
-
"#Frequency, Propability\n",
|
39
|
-
"unique_words = set(word_tokens)\n",
|
40
|
-
"print(f\"TOTAL WORDS IN THE CORPUS : {len(word_tokens)}\")\n",
|
41
|
-
"print(f\"UNIQUE WORDS : {len(unique_words)}\")\n",
|
42
|
-
"\n",
|
43
|
-
"frequency = {word : word_tokens.count(word) for word in unique_words}\n",
|
44
|
-
"propability = {word : frequency[word]/len(word_tokens) for word in unique_words}"
|
45
|
-
]
|
46
|
-
},
|
47
|
-
{
|
48
|
-
"cell_type": "code",
|
49
|
-
"execution_count": null,
|
50
|
-
"id": "0d5fc074-8256-43e6-b57c-e62cde3b05d2",
|
51
|
-
"metadata": {},
|
52
|
-
"outputs": [],
|
53
|
-
"source": [
|
54
|
-
"#Generating Bigrams, frequency and propability of bigrams\n",
|
55
|
-
"bigrams = zip(word_tokens[:-1], word_tokens[1:])\n",
|
56
|
-
"bigram_freq = {}\n",
|
57
|
-
"bigram_count = 0\n",
|
58
|
-
"for bigram in bigrams :\n",
|
59
|
-
" bigram_count += 1\n",
|
60
|
-
" if bigram in bigram_freq :\n",
|
61
|
-
" bigram_freq[bigram] += 1\n",
|
62
|
-
" else :\n",
|
63
|
-
" bigram_freq[bigram] = 1\n",
|
64
|
-
"bigram_prop = {}\n",
|
65
|
-
"for bigram, freq in bigram_freq.items() : \n",
|
66
|
-
" bigram_prop[bigram] = freq/bigram_count\n",
|
67
|
-
"print(\"TOTAL UNIQUE BIGRAMS :\", len(bigram_freq))"
|
68
|
-
]
|
69
|
-
},
|
70
|
-
{
|
71
|
-
"cell_type": "code",
|
72
|
-
"execution_count": null,
|
73
|
-
"id": "d064f6da-7399-4e4c-aa08-4d65c37443d5",
|
74
|
-
"metadata": {},
|
75
|
-
"outputs": [],
|
76
|
-
"source": [
|
77
|
-
"import math\n",
|
78
|
-
"from scipy.stats import t,chi2 #For Critical value(feed value if givem)\n",
|
79
|
-
"#T-test demonstration\n",
|
80
|
-
"t_colloc = []\n",
|
81
|
-
"n = len(word_tokens)\n",
|
82
|
-
"t_critical = t.ppf(1-0.05, n-1)\n",
|
83
|
-
"for bigram, prop in bigram_prop.items() :\n",
|
84
|
-
" w1, w2 = bigram\n",
|
85
|
-
" mu = propability[w1] * propability[w2]\n",
|
86
|
-
" X_ = prop\n",
|
87
|
-
" t_stat = (X_ - mu)/math.sqrt((X_*(1-X_))/n)\n",
|
88
|
-
" if t_stat > t_critical :\n",
|
89
|
-
" t_colloc.append(bigram)\n",
|
90
|
-
"print(f\"{len(t_colloc)} COLLOCATIONS IN THE CORPUS DETERMINED FROM T-TEST : \\n\")\n",
|
91
|
-
"print(t_colloc)"
|
92
|
-
]
|
93
|
-
},
|
94
|
-
{
|
95
|
-
"cell_type": "code",
|
96
|
-
"execution_count": null,
|
97
|
-
"id": "329688e7-5256-44e3-bfe2-d78a7476b44b",
|
98
|
-
"metadata": {},
|
99
|
-
"outputs": [],
|
100
|
-
"source": [
|
101
|
-
"#Chi^2 TEST demonstration\n",
|
102
|
-
"chi_colloc = []\n",
|
103
|
-
"n = len(word_tokens)\n",
|
104
|
-
"chi_critical = chi2.ppf(1-0.05, 1)\n",
|
105
|
-
"for bigram, prop in bigram_prop.items() :\n",
|
106
|
-
" w1, w2 = bigram\n",
|
107
|
-
" f1 = frequency[w1]\n",
|
108
|
-
" f2 = frequency[w2]\n",
|
109
|
-
" #Observed Frequencies\n",
|
110
|
-
" o_1_2 = bigram_freq[bigram]\n",
|
111
|
-
" o_n1_2 = f2 - o_1_2\n",
|
112
|
-
" o_1_n2 = f1 - o_1_2\n",
|
113
|
-
" o_n1_n2 = n - (o_1_2 + o_n1_2 + o_1_n2)\n",
|
114
|
-
" obs = [o_1_2, o_n1_2, o_1_n2, o_n1_n2]\n",
|
115
|
-
" #Excepcted frequencies\n",
|
116
|
-
" e_1_2 = (f1 * f2)/n\n",
|
117
|
-
" e_n1_2 = ((n - f1) * f2)/n\n",
|
118
|
-
" e_1_n2 = (f1 * (n - f2))/n\n",
|
119
|
-
" e_n1_n2 = ((n - f1)*(n - f2))/n\n",
|
120
|
-
" exp = [e_1_2, e_n1_2, e_1_n2, e_n1_n2]\n",
|
121
|
-
" chi_stat = sum( ((obs[i] - exp[i])**2)/exp[i] for i in range(4))\n",
|
122
|
-
" if chi_stat > chi_critical :\n",
|
123
|
-
" chi_colloc.append(bigram)\n",
|
124
|
-
"print(f\"{len(chi_colloc)} COLLOCATIONS IN THE CORPUS DETERMINED FROM CHI^2-TEST : \\n\")\n",
|
125
|
-
"print(chi_colloc)\n",
|
126
|
-
" "
|
127
|
-
]
|
128
|
-
},
|
129
|
-
{
|
130
|
-
"cell_type": "code",
|
131
|
-
"execution_count": null,
|
132
|
-
"id": "0e4398af-30f7-4eaa-9b2c-fe55d1974d70",
|
133
|
-
"metadata": {},
|
134
|
-
"outputs": [],
|
135
|
-
"source": [
|
136
|
-
"f1 = 15828\n",
|
137
|
-
"f2 = 4675\n",
|
138
|
-
"n = 14307676\n",
|
139
|
-
"#Observed Frequencies\n",
|
140
|
-
"o_1_2 = 8\n",
|
141
|
-
"o_n1_2 = f2 - o_1_2\n",
|
142
|
-
"o_1_n2 = f1 - o_1_2\n",
|
143
|
-
"o_n1_n2 = n - (o_1_2 + o_n1_2 + o_1_n2)\n",
|
144
|
-
"obs = [o_1_2, o_n1_2, o_1_n2, o_n1_n2]\n",
|
145
|
-
"#Excepcted frequencies\n",
|
146
|
-
"e_1_2 = (f1 * f2)/n\n",
|
147
|
-
"e_n1_2 = ((n - f1) * f2)/n\n",
|
148
|
-
"e_1_n2 = (f1 * (n - f2))/n\n",
|
149
|
-
"e_n1_n2 = ((n - f1)*(n - f2))/n\n",
|
150
|
-
"exp = [e_1_2, e_n1_2, e_1_n2, e_n1_n2]\n",
|
151
|
-
"chi_stat = sum( ((obs[i] - exp[i])**2)/exp[i] for i in range(4))\n",
|
152
|
-
"print(chi_stat)"
|
153
|
-
]
|
154
|
-
},
|
155
|
-
{
|
156
|
-
"cell_type": "code",
|
157
|
-
"execution_count": null,
|
158
|
-
"id": "2f065df9-3caa-4f59-94b2-5c65b0fc47d0",
|
159
|
-
"metadata": {},
|
160
|
-
"outputs": [],
|
161
|
-
"source": []
|
162
|
-
}
|
163
|
-
],
|
164
|
-
"metadata": {
|
165
|
-
"kernelspec": {
|
166
|
-
"display_name": "Python 3 (ipykernel)",
|
167
|
-
"language": "python",
|
168
|
-
"name": "python3"
|
169
|
-
},
|
170
|
-
"language_info": {
|
171
|
-
"codemirror_mode": {
|
172
|
-
"name": "ipython",
|
173
|
-
"version": 3
|
174
|
-
},
|
175
|
-
"file_extension": ".py",
|
176
|
-
"mimetype": "text/x-python",
|
177
|
-
"name": "python",
|
178
|
-
"nbconvert_exporter": "python",
|
179
|
-
"pygments_lexer": "ipython3",
|
180
|
-
"version": "3.12.4"
|
181
|
-
}
|
182
|
-
},
|
183
|
-
"nbformat": 4,
|
184
|
-
"nbformat_minor": 5
|
185
|
-
}
|