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,204 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": 1,
|
6
|
-
"id": "fbde4a26-a923-4b2a-a20a-5010ae791ff0",
|
7
|
-
"metadata": {},
|
8
|
-
"outputs": [
|
9
|
-
{
|
10
|
-
"name": "stderr",
|
11
|
-
"output_type": "stream",
|
12
|
-
"text": [
|
13
|
-
"[nltk_data] Downloading package stopwords to\n",
|
14
|
-
"[nltk_data] C:\\Users\\sugan\\AppData\\Roaming\\nltk_data...\n",
|
15
|
-
"[nltk_data] Package stopwords is already up-to-date!\n",
|
16
|
-
"[nltk_data] Downloading package punkt to\n",
|
17
|
-
"[nltk_data] C:\\Users\\sugan\\AppData\\Roaming\\nltk_data...\n",
|
18
|
-
"[nltk_data] Package punkt is already up-to-date!\n"
|
19
|
-
]
|
20
|
-
},
|
21
|
-
{
|
22
|
-
"data": {
|
23
|
-
"text/plain": [
|
24
|
-
"True"
|
25
|
-
]
|
26
|
-
},
|
27
|
-
"execution_count": 1,
|
28
|
-
"metadata": {},
|
29
|
-
"output_type": "execute_result"
|
30
|
-
}
|
31
|
-
],
|
32
|
-
"source": [
|
33
|
-
"import nltk\n",
|
34
|
-
"nltk.download('stopwords')\n",
|
35
|
-
"nltk.download('punkt')"
|
36
|
-
]
|
37
|
-
},
|
38
|
-
{
|
39
|
-
"cell_type": "code",
|
40
|
-
"execution_count": 2,
|
41
|
-
"id": "80964614-3a9a-4ec4-8765-08c2ad506753",
|
42
|
-
"metadata": {},
|
43
|
-
"outputs": [
|
44
|
-
{
|
45
|
-
"name": "stdout",
|
46
|
-
"output_type": "stream",
|
47
|
-
"text": [
|
48
|
-
"['#', '#', '#', 'The', 'Impact', 'of', 'Social', 'Media', 'on', 'Modern', 'Communication', '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', '.', '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', '.', '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', '.', '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', '.', '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', '.', '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', '.', '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', '.']\n"
|
49
|
-
]
|
50
|
-
}
|
51
|
-
],
|
52
|
-
"source": [
|
53
|
-
"from nltk.corpus import stopwords\n",
|
54
|
-
"from nltk.tokenize import word_tokenize\n",
|
55
|
-
"\n",
|
56
|
-
"f=open(\"sample1.txt\",\"r\")\n",
|
57
|
-
"text=f.read()\n",
|
58
|
-
"\n",
|
59
|
-
"stop_words = set(stopwords.words(\"english\"))\n",
|
60
|
-
"word_tokens = word_tokenize(text)\n",
|
61
|
-
"fil_text = [word for word in word_tokens if word.lower() not in stop_words]\n",
|
62
|
-
"print(word_tokens)"
|
63
|
-
]
|
64
|
-
},
|
65
|
-
{
|
66
|
-
"cell_type": "code",
|
67
|
-
"execution_count": 3,
|
68
|
-
"id": "ba06d703-8acf-47bc-b5cf-164e1af401c5",
|
69
|
-
"metadata": {},
|
70
|
-
"outputs": [
|
71
|
-
{
|
72
|
-
"name": "stdin",
|
73
|
-
"output_type": "stream",
|
74
|
-
"text": [
|
75
|
-
"enter the critical value : 1\n"
|
76
|
-
]
|
77
|
-
},
|
78
|
-
{
|
79
|
-
"name": "stdout",
|
80
|
-
"output_type": "stream",
|
81
|
-
"text": [
|
82
|
-
"0.7496463932107497\n",
|
83
|
-
"[',', 'share', 0.7496463932107497]\n"
|
84
|
-
]
|
85
|
-
}
|
86
|
-
],
|
87
|
-
"source": [
|
88
|
-
"import random\n",
|
89
|
-
"def collocation(w1,w2):\n",
|
90
|
-
" nl=list()\n",
|
91
|
-
" N=len(word_tokens)\n",
|
92
|
-
" prob_w1=word_tokens.count(w1)/N\n",
|
93
|
-
" prob_w2=word_tokens.count(w2)/N\n",
|
94
|
-
" pop_mean=prob_w1*prob_w2\n",
|
95
|
-
" count_w1w2=0\n",
|
96
|
-
" for i in range(len(word_tokens)-1):\n",
|
97
|
-
" if(word_tokens[i]==w1 and word_tokens[i+1]==w2):\n",
|
98
|
-
" count_w1w2=count_w1w2+1\n",
|
99
|
-
" sam_mean=count_w1w2/N\n",
|
100
|
-
" t=(sam_mean-pop_mean)/(sam_mean/N)**0.5\n",
|
101
|
-
" cv=input(\"enter the critical value : \")\n",
|
102
|
-
" if(float(t) > float(cv)):\n",
|
103
|
-
" print(f\"hypothesis rejected thus the given words ('{w1}', '{w2}') form a collocation\")\n",
|
104
|
-
" print(t)\n",
|
105
|
-
" nl.append(w1)\n",
|
106
|
-
" nl.append(w2)\n",
|
107
|
-
" nl.append(t)\n",
|
108
|
-
" print(nl)\n",
|
109
|
-
"fcol=list()\n",
|
110
|
-
"i = random.randint(0,len(word_tokens))\n",
|
111
|
-
"#for i in range(len(word_tokens)-1):\n",
|
112
|
-
"w1=word_tokens[i]\n",
|
113
|
-
"w2=word_tokens[i+1]\n",
|
114
|
-
"fcol.append(collocation(w1,w2))"
|
115
|
-
]
|
116
|
-
},
|
117
|
-
{
|
118
|
-
"cell_type": "code",
|
119
|
-
"execution_count": 4,
|
120
|
-
"id": "2b3fa554-68cb-445d-bd94-86c1a95b9790",
|
121
|
-
"metadata": {},
|
122
|
-
"outputs": [
|
123
|
-
{
|
124
|
-
"name": "stdin",
|
125
|
-
"output_type": "stream",
|
126
|
-
"text": [
|
127
|
-
"enter the critical value : 2\n"
|
128
|
-
]
|
129
|
-
},
|
130
|
-
{
|
131
|
-
"name": "stdout",
|
132
|
-
"output_type": "stream",
|
133
|
-
"text": [
|
134
|
-
"hypothesis accepted thus the given words ('to', 'express') does not form a collocation\n"
|
135
|
-
]
|
136
|
-
}
|
137
|
-
],
|
138
|
-
"source": [
|
139
|
-
"import random\n",
|
140
|
-
"def collocation(w1,w2):\n",
|
141
|
-
" nl=list()\n",
|
142
|
-
" N=len(word_tokens)\n",
|
143
|
-
" count_w1=word_tokens.count(w1)\n",
|
144
|
-
" count_w2=word_tokens.count(w2)\n",
|
145
|
-
"\n",
|
146
|
-
" Exp_w1w2= ((count_w1*count_w2)/N) \n",
|
147
|
-
" Exp_w1nw2= ((count_w1*(N-count_w2))/N)\n",
|
148
|
-
" Exp_nw1w2= (((N-count_w1)*count_w2)/N)\n",
|
149
|
-
" Exp_nw1nw2= (((N-count_w1)*(N-count_w2)/N))\n",
|
150
|
-
"\n",
|
151
|
-
" j=0\n",
|
152
|
-
" count_w1w2=0\n",
|
153
|
-
" for i in range(len(word_tokens)):\n",
|
154
|
-
" if(word_tokens[i]==w1 and word_tokens[i+1]==w2):\n",
|
155
|
-
" count_w1w2=count_w1w2+1\n",
|
156
|
-
" count_w1w2=j\n",
|
157
|
-
" \n",
|
158
|
-
" Obs_w1w2=count_w1w2\n",
|
159
|
-
" Obs_w1nw2=count_w1-count_w1w2\n",
|
160
|
-
" Obs_nw1w2=count_w2-count_w1w2\n",
|
161
|
-
" Obs_nw1nw2=N-count_w1w2\n",
|
162
|
-
"\n",
|
163
|
-
" X= (((Obs_w1w2-Exp_w1w2)**2)/Exp_w1w2) + (((Obs_w1nw2-Exp_w1nw2)**2)/Exp_w1nw2) + (((Obs_nw1w2-Exp_nw1w2)**2)/Exp_nw1w2) + (((Obs_nw1nw2-Exp_nw1nw2)**2)/Exp_nw1nw2)\n",
|
164
|
-
" cv=int(input(\"enter the critical value : \"))\n",
|
165
|
-
" if(float(X) > float(cv)):\n",
|
166
|
-
" print(f\"hypothesis rejected thus the given words ('{w1}', '{w2}') form a collocation\")\n",
|
167
|
-
" print(X)\n",
|
168
|
-
" nl.append(w1)\n",
|
169
|
-
" nl.append(w2)\n",
|
170
|
-
" nl.append(X)\n",
|
171
|
-
" else:print(f\"hypothesis accepted thus the given words ('{w1}', '{w2}') does not form a collocation\")\n",
|
172
|
-
" return nl\n",
|
173
|
-
" \n",
|
174
|
-
"fcol=list()\n",
|
175
|
-
"i = random.randint(0,len(word_tokens))\n",
|
176
|
-
"#for i in range(len(word_tokens)-1):\n",
|
177
|
-
"w1=word_tokens[i]\n",
|
178
|
-
"w2=word_tokens[i+1]\n",
|
179
|
-
"fcol.append(collocation(w1,w2))"
|
180
|
-
]
|
181
|
-
}
|
182
|
-
],
|
183
|
-
"metadata": {
|
184
|
-
"kernelspec": {
|
185
|
-
"display_name": "Python 3 (ipykernel)",
|
186
|
-
"language": "python",
|
187
|
-
"name": "python3"
|
188
|
-
},
|
189
|
-
"language_info": {
|
190
|
-
"codemirror_mode": {
|
191
|
-
"name": "ipython",
|
192
|
-
"version": 3
|
193
|
-
},
|
194
|
-
"file_extension": ".py",
|
195
|
-
"mimetype": "text/x-python",
|
196
|
-
"name": "python",
|
197
|
-
"nbconvert_exporter": "python",
|
198
|
-
"pygments_lexer": "ipython3",
|
199
|
-
"version": "3.12.4"
|
200
|
-
}
|
201
|
-
},
|
202
|
-
"nbformat": 4,
|
203
|
-
"nbformat_minor": 5
|
204
|
-
}
|
@@ -1,234 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": 1,
|
6
|
-
"id": "378d2a7f-b3ec-4228-b436-58e4c551adf1",
|
7
|
-
"metadata": {},
|
8
|
-
"outputs": [
|
9
|
-
{
|
10
|
-
"name": "stderr",
|
11
|
-
"output_type": "stream",
|
12
|
-
"text": [
|
13
|
-
"[nltk_data] Downloading package stopwords to\n",
|
14
|
-
"[nltk_data] C:\\Users\\sugan\\AppData\\Roaming\\nltk_data...\n",
|
15
|
-
"[nltk_data] Package stopwords is already up-to-date!\n",
|
16
|
-
"[nltk_data] Downloading package punkt to\n",
|
17
|
-
"[nltk_data] C:\\Users\\sugan\\AppData\\Roaming\\nltk_data...\n",
|
18
|
-
"[nltk_data] Package punkt is already up-to-date!\n"
|
19
|
-
]
|
20
|
-
}
|
21
|
-
],
|
22
|
-
"source": [
|
23
|
-
"import nltk\n",
|
24
|
-
"nltk.download('stopwords')\n",
|
25
|
-
"nltk.download('punkt')\n",
|
26
|
-
"from nltk.corpus import stopwords\n",
|
27
|
-
"from nltk.tokenize import word_tokenize"
|
28
|
-
]
|
29
|
-
},
|
30
|
-
{
|
31
|
-
"cell_type": "code",
|
32
|
-
"execution_count": 2,
|
33
|
-
"id": "e5418f7e-eb6c-4663-af6e-1f05e5e3ee14",
|
34
|
-
"metadata": {},
|
35
|
-
"outputs": [],
|
36
|
-
"source": [
|
37
|
-
"import pandas as pd\n",
|
38
|
-
"import math"
|
39
|
-
]
|
40
|
-
},
|
41
|
-
{
|
42
|
-
"cell_type": "code",
|
43
|
-
"execution_count": 3,
|
44
|
-
"id": "b902b1ab-918a-47d9-b57c-3ab140756a71",
|
45
|
-
"metadata": {},
|
46
|
-
"outputs": [],
|
47
|
-
"source": [
|
48
|
-
"f=open(\"sample2.txt\")\n",
|
49
|
-
"text=f.read()\n",
|
50
|
-
"data=text.splitlines()"
|
51
|
-
]
|
52
|
-
},
|
53
|
-
{
|
54
|
-
"cell_type": "code",
|
55
|
-
"execution_count": 4,
|
56
|
-
"id": "7636c47c-2f57-49ff-ab65-f326ed209def",
|
57
|
-
"metadata": {},
|
58
|
-
"outputs": [],
|
59
|
-
"source": [
|
60
|
-
"ds=list()\n",
|
61
|
-
"for i in data:\n",
|
62
|
-
" tokens=word_tokenize(i)\n",
|
63
|
-
" ds.append(tokens)"
|
64
|
-
]
|
65
|
-
},
|
66
|
-
{
|
67
|
-
"cell_type": "code",
|
68
|
-
"execution_count": 5,
|
69
|
-
"id": "4ed7e570-1bb2-447b-9762-4db619615a23",
|
70
|
-
"metadata": {},
|
71
|
-
"outputs": [
|
72
|
-
{
|
73
|
-
"name": "stdout",
|
74
|
-
"output_type": "stream",
|
75
|
-
"text": [
|
76
|
-
"['chair', 'put', 'coat', ',', 'back', 'Furniture']\n",
|
77
|
-
"['chair', 'IT', 'department', 'Furniture']\n",
|
78
|
-
"['where', 'here', 'put', 'chair', 'Furniture']\n",
|
79
|
-
"['CSE', 'chair', 'head', 'Position']\n"
|
80
|
-
]
|
81
|
-
}
|
82
|
-
],
|
83
|
-
"source": [
|
84
|
-
"for i in ds:\n",
|
85
|
-
" print(i)"
|
86
|
-
]
|
87
|
-
},
|
88
|
-
{
|
89
|
-
"cell_type": "code",
|
90
|
-
"execution_count": 6,
|
91
|
-
"id": "5b5525b9-9c64-4604-ad57-37d6674bfee9",
|
92
|
-
"metadata": {},
|
93
|
-
"outputs": [
|
94
|
-
{
|
95
|
-
"name": "stdin",
|
96
|
-
"output_type": "stream",
|
97
|
-
"text": [
|
98
|
-
"enter sentence: coat black chair\n",
|
99
|
-
"enter word to find sense: chair\n"
|
100
|
-
]
|
101
|
-
},
|
102
|
-
{
|
103
|
-
"name": "stdout",
|
104
|
-
"output_type": "stream",
|
105
|
-
"text": [
|
106
|
-
"-2.0 -3.0\n"
|
107
|
-
]
|
108
|
-
}
|
109
|
-
],
|
110
|
-
"source": [
|
111
|
-
"test_sen = input(\"enter sentence:\")\n",
|
112
|
-
"test_sen = test_sen.split(\" \")\n",
|
113
|
-
"sense_word = input(\"enter word to find sense:\")\n",
|
114
|
-
"\n",
|
115
|
-
" #let us assume that there are two senses(furniture,position)\n",
|
116
|
-
"cf = float(text.count(\"Furniture\"))\n",
|
117
|
-
"cp = float(text.count(\"Position\"))\n",
|
118
|
-
"#12 unique vocabularies\n",
|
119
|
-
"scoref = math.log2((cf+1)/(cf+cp+12))\n",
|
120
|
-
"scorep = math.log2((cp+1)/(cf+cp+12))\n",
|
121
|
-
"print(scoref,scorep)"
|
122
|
-
]
|
123
|
-
},
|
124
|
-
{
|
125
|
-
"cell_type": "code",
|
126
|
-
"execution_count": 7,
|
127
|
-
"id": "11de99e1-3654-4c51-acf3-fd1f9daeaa0b",
|
128
|
-
"metadata": {},
|
129
|
-
"outputs": [],
|
130
|
-
"source": [
|
131
|
-
"fur = list()\n",
|
132
|
-
"pos = list()\n",
|
133
|
-
"for i in ds:\n",
|
134
|
-
" if(\"Furniture\" in i):\n",
|
135
|
-
" fur.append(i)\n",
|
136
|
-
" else:\n",
|
137
|
-
" pos.append(i)"
|
138
|
-
]
|
139
|
-
},
|
140
|
-
{
|
141
|
-
"cell_type": "code",
|
142
|
-
"execution_count": 8,
|
143
|
-
"id": "69385d62-91b3-4df5-a11d-7a60c73401e5",
|
144
|
-
"metadata": {},
|
145
|
-
"outputs": [
|
146
|
-
{
|
147
|
-
"name": "stdout",
|
148
|
-
"output_type": "stream",
|
149
|
-
"text": [
|
150
|
-
"f: 1\n",
|
151
|
-
"pf: 0.13333333333333333\n",
|
152
|
-
"p: 0\n",
|
153
|
-
"pp: 0.07692307692307693\n",
|
154
|
-
"final scoref -4.906890595608519\n",
|
155
|
-
"final scorep -6.700439718141093\n",
|
156
|
-
"f: 0\n",
|
157
|
-
"pf: 0.06666666666666667\n",
|
158
|
-
"p: 0\n",
|
159
|
-
"pp: 0.07692307692307693\n",
|
160
|
-
"final scoref -5.906890595608519\n",
|
161
|
-
"final scorep -6.700439718141093\n",
|
162
|
-
"f: 3\n",
|
163
|
-
"pf: 0.26666666666666666\n",
|
164
|
-
"p: 1\n",
|
165
|
-
"pp: 0.15384615384615385\n",
|
166
|
-
"final scoref -3.9068905956085187\n",
|
167
|
-
"final scorep -5.700439718141093\n"
|
168
|
-
]
|
169
|
-
}
|
170
|
-
],
|
171
|
-
"source": [
|
172
|
-
"for word in test_sen:\n",
|
173
|
-
" p=0\n",
|
174
|
-
" f=0\n",
|
175
|
-
" for i in fur:\n",
|
176
|
-
" if(word in i):\n",
|
177
|
-
" f=f+1\n",
|
178
|
-
" for i in pos:\n",
|
179
|
-
" if(word in i):\n",
|
180
|
-
" p=p+1\n",
|
181
|
-
" print(\"f: \",f)\n",
|
182
|
-
" print(\"pf: \",(f+1)/(cf+12))\n",
|
183
|
-
" print(\"p: \",p)\n",
|
184
|
-
" print(\"pp: \",(p+1)/(cp+12))\n",
|
185
|
-
" final_scoref= scoref + math.log2(((f+1)/(cf+12)))\n",
|
186
|
-
" print(\"final scoref\",final_scoref)\n",
|
187
|
-
" final_scorep= scorep + math.log2(((p+1)/(cp+12)))\n",
|
188
|
-
" print(\"final scorep\",final_scorep)"
|
189
|
-
]
|
190
|
-
},
|
191
|
-
{
|
192
|
-
"cell_type": "code",
|
193
|
-
"execution_count": 9,
|
194
|
-
"id": "49bba1b5-0bfb-4dc8-92a3-0560ae2f01e1",
|
195
|
-
"metadata": {},
|
196
|
-
"outputs": [
|
197
|
-
{
|
198
|
-
"name": "stdout",
|
199
|
-
"output_type": "stream",
|
200
|
-
"text": [
|
201
|
-
"the given chair is of sense Furniture in the given sentence\n"
|
202
|
-
]
|
203
|
-
}
|
204
|
-
],
|
205
|
-
"source": [
|
206
|
-
"if(final_scorep > final_scoref):\n",
|
207
|
-
" print(\"the given \",sense_word,\"is of sense Position in the given sentence\")\n",
|
208
|
-
"else:\n",
|
209
|
-
" print(\"the given \",sense_word,\"is of sense Furniture in the given sentence\")"
|
210
|
-
]
|
211
|
-
}
|
212
|
-
],
|
213
|
-
"metadata": {
|
214
|
-
"kernelspec": {
|
215
|
-
"display_name": "Python 3 (ipykernel)",
|
216
|
-
"language": "python",
|
217
|
-
"name": "python3"
|
218
|
-
},
|
219
|
-
"language_info": {
|
220
|
-
"codemirror_mode": {
|
221
|
-
"name": "ipython",
|
222
|
-
"version": 3
|
223
|
-
},
|
224
|
-
"file_extension": ".py",
|
225
|
-
"mimetype": "text/x-python",
|
226
|
-
"name": "python",
|
227
|
-
"nbconvert_exporter": "python",
|
228
|
-
"pygments_lexer": "ipython3",
|
229
|
-
"version": "3.12.4"
|
230
|
-
}
|
231
|
-
},
|
232
|
-
"nbformat": 4,
|
233
|
-
"nbformat_minor": 5
|
234
|
-
}
|
@@ -1,128 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": 1,
|
6
|
-
"id": "fb6ea3e5-356f-49e6-add7-9ea4730f9f0a",
|
7
|
-
"metadata": {},
|
8
|
-
"outputs": [
|
9
|
-
{
|
10
|
-
"name": "stdin",
|
11
|
-
"output_type": "stream",
|
12
|
-
"text": [
|
13
|
-
"Enter the preposition : with\n",
|
14
|
-
"Enter the noun : phone\n",
|
15
|
-
"Enter the Verb : wait\n"
|
16
|
-
]
|
17
|
-
},
|
18
|
-
{
|
19
|
-
"name": "stdout",
|
20
|
-
"output_type": "stream",
|
21
|
-
"text": [
|
22
|
-
"[('saw', 'phone')]\n",
|
23
|
-
"[('went', 'meeting'), ('meeting', 'yesterday')]\n",
|
24
|
-
"[('told', 'man'), ('man', 'wait')]\n",
|
25
|
-
"[('gave', 'book')]\n",
|
26
|
-
"[('saw', 'cat')]\n",
|
27
|
-
"{'saw': 2, 'phone': 1, 'went': 1, 'meeting': 1, 'yesterday': 1, 'told': 1, 'man': 1, 'wait': 1, 'gave': 1, 'book': 1, 'cat': 1}\n",
|
28
|
-
"{'phone': 1, 'yesterday': 2, 'wait': 2, 'book': 1, 'cat': 1}\n",
|
29
|
-
"0\n",
|
30
|
-
"1\n",
|
31
|
-
"0\n",
|
32
|
-
"1\n",
|
33
|
-
"no attachment\n"
|
34
|
-
]
|
35
|
-
}
|
36
|
-
],
|
37
|
-
"source": [
|
38
|
-
"import nltk\n",
|
39
|
-
"import math\n",
|
40
|
-
"from nltk.tokenize import word_tokenize\n",
|
41
|
-
"import string\n",
|
42
|
-
"from nltk.corpus import stopwords\n",
|
43
|
-
"from nltk import bigrams\n",
|
44
|
-
"\n",
|
45
|
-
"prep = input(\"Enter the preposition : \")\n",
|
46
|
-
"noun = input(\"Enter the noun : \")\n",
|
47
|
-
"verb = input(\"Enter the Verb : \")\n",
|
48
|
-
"\n",
|
49
|
-
"stop_words = set(stopwords.words(\"english\"))\n",
|
50
|
-
"\n",
|
51
|
-
"sentences = [\n",
|
52
|
-
" \"Saw the phone with me.\",\n",
|
53
|
-
" \"Went to the meeting yesterday.\",\n",
|
54
|
-
" \"Told the man to wait.\",\n",
|
55
|
-
" \"Gave the book to her.\",\n",
|
56
|
-
" \"Saw the cat with her.\"\n",
|
57
|
-
"]\n",
|
58
|
-
"\n",
|
59
|
-
"unigram = {}\n",
|
60
|
-
"bigram = {}\n",
|
61
|
-
"\n",
|
62
|
-
"for sentence in sentences:\n",
|
63
|
-
" tokens = word_tokenize(sentence)\n",
|
64
|
-
" tokens = [token.lower() for token in tokens if token not in string.punctuation and token not in stop_words]\n",
|
65
|
-
" bigr = list(bigrams(tokens))\n",
|
66
|
-
" print(bigr)\n",
|
67
|
-
" for word in tokens:\n",
|
68
|
-
" if word in unigram:\n",
|
69
|
-
" unigram[word]+=1\n",
|
70
|
-
" else:\n",
|
71
|
-
" unigram[word] = 1\n",
|
72
|
-
" for bi in bigr:\n",
|
73
|
-
" if word in bigram:\n",
|
74
|
-
" bigram[word]+=1\n",
|
75
|
-
" else:\n",
|
76
|
-
" bigram[word] = 1\n",
|
77
|
-
"\n",
|
78
|
-
"print(unigram)\n",
|
79
|
-
"print(bigram)\n",
|
80
|
-
"\n",
|
81
|
-
"bigram.setdefault((noun.lower(),prep.lower()),0)\n",
|
82
|
-
"bigram.setdefault((verb.lower(),prep.lower()),0)\n",
|
83
|
-
"unigram.setdefault(noun.lower(),0)\n",
|
84
|
-
"unigram.setdefault(verb.lower(),0)\n",
|
85
|
-
"unigram.setdefault(prep.lower(),0)\n",
|
86
|
-
"\n",
|
87
|
-
"print(bigram[(noun.lower(),prep.lower())])\n",
|
88
|
-
"print(unigram[noun.lower()])\n",
|
89
|
-
"print(bigram[(verb.lower(),prep.lower())])\n",
|
90
|
-
"print(unigram[verb.lower()])\n",
|
91
|
-
"\n",
|
92
|
-
"pn = bigram[(noun.lower(),prep.lower())]/unigram[noun.lower()]\n",
|
93
|
-
"pv = bigram[(verb.lower(),prep.lower())]/unigram[verb.lower()]\n",
|
94
|
-
"\n",
|
95
|
-
"try: \n",
|
96
|
-
" lam = math.log2((pv*(1-pn))/pn)\n",
|
97
|
-
" if lam < 1:\n",
|
98
|
-
" print(\"attached with noun\")\n",
|
99
|
-
" else:\n",
|
100
|
-
" print(\"attached with verb\")\n",
|
101
|
-
"except ZeroDivisionError as e:\n",
|
102
|
-
" print(\"no attachment\")\n",
|
103
|
-
" "
|
104
|
-
]
|
105
|
-
}
|
106
|
-
],
|
107
|
-
"metadata": {
|
108
|
-
"kernelspec": {
|
109
|
-
"display_name": "Python 3 (ipykernel)",
|
110
|
-
"language": "python",
|
111
|
-
"name": "python3"
|
112
|
-
},
|
113
|
-
"language_info": {
|
114
|
-
"codemirror_mode": {
|
115
|
-
"name": "ipython",
|
116
|
-
"version": 3
|
117
|
-
},
|
118
|
-
"file_extension": ".py",
|
119
|
-
"mimetype": "text/x-python",
|
120
|
-
"name": "python",
|
121
|
-
"nbconvert_exporter": "python",
|
122
|
-
"pygments_lexer": "ipython3",
|
123
|
-
"version": "3.12.4"
|
124
|
-
}
|
125
|
-
},
|
126
|
-
"nbformat": 4,
|
127
|
-
"nbformat_minor": 5
|
128
|
-
}
|