noshot 0.1.7__py3-none-any.whl → 0.1.9__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/data/ML TS XAI/TS/1. EDA - Handling Time Series Data/Handling TS Data.ipynb +784 -0
- noshot/data/ML TS XAI/TS/1. EDA - Handling Time Series Data/raw_sales.csv +29581 -0
- noshot/data/ML TS XAI/TS/2. Feature Engineering/Feature Engineering-.ipynb +1445 -0
- noshot/data/ML TS XAI/TS/3. Temporal Relationships/Exploring Temporal Relationships.ipynb +603 -0
- noshot/data/ML TS XAI/TS/4. Up-Down-Sampling and Interploation/Up-Down-Sampling.ipynb +721 -0
- noshot/data/ML TS XAI/TS/4. Up-Down-Sampling and Interploation/shampoo_sales.csv +37 -0
- noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality/Stationarity-Trend-Seasonality.ipynb +392 -0
- noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality/daily-min-temperatures.csv +3651 -0
- noshot/data/ML TS XAI/TS/5. Stationarity - Trend - Seasonality/daily-total-female-births.csv +366 -0
- noshot/data/ML TS XAI/TS/6. Autocorrelation - Partial Autocorrelation/ACF-PACF.ipynb +175 -0
- noshot/data/ML TS XAI/TS/6. Autocorrelation - Partial Autocorrelation/daily-min-temperatures.csv +3651 -0
- {noshot-0.1.7.dist-info → noshot-0.1.9.dist-info}/METADATA +2 -2
- noshot-0.1.9.dist-info/RECORD +35 -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.9.dist-info}/LICENSE.txt +0 -0
- {noshot-0.1.7.dist-info → noshot-0.1.9.dist-info}/WHEEL +0 -0
- {noshot-0.1.7.dist-info → noshot-0.1.9.dist-info}/top_level.txt +0 -0
@@ -1,645 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": 50,
|
6
|
-
"metadata": {},
|
7
|
-
"outputs": [],
|
8
|
-
"source": [
|
9
|
-
"import pandas as pd\n",
|
10
|
-
"import numpy as np\n",
|
11
|
-
"from nltk.util import bigrams\n",
|
12
|
-
"from nltk.corpus import stopwords\n",
|
13
|
-
"from nltk.tokenize import word_tokenize\n",
|
14
|
-
"import string"
|
15
|
-
]
|
16
|
-
},
|
17
|
-
{
|
18
|
-
"cell_type": "code",
|
19
|
-
"execution_count": 51,
|
20
|
-
"metadata": {},
|
21
|
-
"outputs": [
|
22
|
-
{
|
23
|
-
"data": {
|
24
|
-
"text/html": [
|
25
|
-
"<div>\n",
|
26
|
-
"<style scoped>\n",
|
27
|
-
" .dataframe tbody tr th:only-of-type {\n",
|
28
|
-
" vertical-align: middle;\n",
|
29
|
-
" }\n",
|
30
|
-
"\n",
|
31
|
-
" .dataframe tbody tr th {\n",
|
32
|
-
" vertical-align: top;\n",
|
33
|
-
" }\n",
|
34
|
-
"\n",
|
35
|
-
" .dataframe thead th {\n",
|
36
|
-
" text-align: right;\n",
|
37
|
-
" }\n",
|
38
|
-
"</style>\n",
|
39
|
-
"<table border=\"1\" class=\"dataframe\">\n",
|
40
|
-
" <thead>\n",
|
41
|
-
" <tr style=\"text-align: right;\">\n",
|
42
|
-
" <th></th>\n",
|
43
|
-
" <th>Sentence</th>\n",
|
44
|
-
" <th>Class</th>\n",
|
45
|
-
" </tr>\n",
|
46
|
-
" </thead>\n",
|
47
|
-
" <tbody>\n",
|
48
|
-
" <tr>\n",
|
49
|
-
" <th>0</th>\n",
|
50
|
-
" <td>I deposited my paycheck at the bank.</td>\n",
|
51
|
-
" <td>Financial Institution</td>\n",
|
52
|
-
" </tr>\n",
|
53
|
-
" <tr>\n",
|
54
|
-
" <th>1</th>\n",
|
55
|
-
" <td>The bank of the river was eroded by the heavy ...</td>\n",
|
56
|
-
" <td>River Border</td>\n",
|
57
|
-
" </tr>\n",
|
58
|
-
" <tr>\n",
|
59
|
-
" <th>2</th>\n",
|
60
|
-
" <td>She works at the bank as a teller.</td>\n",
|
61
|
-
" <td>Financial Institution</td>\n",
|
62
|
-
" </tr>\n",
|
63
|
-
" <tr>\n",
|
64
|
-
" <th>3</th>\n",
|
65
|
-
" <td>Let's have a picnic by the bank of the river.</td>\n",
|
66
|
-
" <td>River Border</td>\n",
|
67
|
-
" </tr>\n",
|
68
|
-
" <tr>\n",
|
69
|
-
" <th>4</th>\n",
|
70
|
-
" <td>The bank approved my loan application.</td>\n",
|
71
|
-
" <td>Financial Institution</td>\n",
|
72
|
-
" </tr>\n",
|
73
|
-
" </tbody>\n",
|
74
|
-
"</table>\n",
|
75
|
-
"</div>"
|
76
|
-
],
|
77
|
-
"text/plain": [
|
78
|
-
" Sentence Class\n",
|
79
|
-
"0 I deposited my paycheck at the bank. Financial Institution\n",
|
80
|
-
"1 The bank of the river was eroded by the heavy ... River Border\n",
|
81
|
-
"2 She works at the bank as a teller. Financial Institution\n",
|
82
|
-
"3 Let's have a picnic by the bank of the river. River Border\n",
|
83
|
-
"4 The bank approved my loan application. Financial Institution"
|
84
|
-
]
|
85
|
-
},
|
86
|
-
"execution_count": 51,
|
87
|
-
"metadata": {},
|
88
|
-
"output_type": "execute_result"
|
89
|
-
}
|
90
|
-
],
|
91
|
-
"source": [
|
92
|
-
"df = pd.read_csv(\"../Bank.csv\")\n",
|
93
|
-
"df = df.iloc[:94]\n",
|
94
|
-
"df.head()"
|
95
|
-
]
|
96
|
-
},
|
97
|
-
{
|
98
|
-
"cell_type": "code",
|
99
|
-
"execution_count": 52,
|
100
|
-
"metadata": {},
|
101
|
-
"outputs": [],
|
102
|
-
"source": [
|
103
|
-
"stops = set(stopwords.words(\"english\"))"
|
104
|
-
]
|
105
|
-
},
|
106
|
-
{
|
107
|
-
"cell_type": "code",
|
108
|
-
"execution_count": 53,
|
109
|
-
"metadata": {},
|
110
|
-
"outputs": [
|
111
|
-
{
|
112
|
-
"data": {
|
113
|
-
"text/html": [
|
114
|
-
"<div>\n",
|
115
|
-
"<style scoped>\n",
|
116
|
-
" .dataframe tbody tr th:only-of-type {\n",
|
117
|
-
" vertical-align: middle;\n",
|
118
|
-
" }\n",
|
119
|
-
"\n",
|
120
|
-
" .dataframe tbody tr th {\n",
|
121
|
-
" vertical-align: top;\n",
|
122
|
-
" }\n",
|
123
|
-
"\n",
|
124
|
-
" .dataframe thead th {\n",
|
125
|
-
" text-align: right;\n",
|
126
|
-
" }\n",
|
127
|
-
"</style>\n",
|
128
|
-
"<table border=\"1\" class=\"dataframe\">\n",
|
129
|
-
" <thead>\n",
|
130
|
-
" <tr style=\"text-align: right;\">\n",
|
131
|
-
" <th></th>\n",
|
132
|
-
" <th>Sentence</th>\n",
|
133
|
-
" <th>Class</th>\n",
|
134
|
-
" </tr>\n",
|
135
|
-
" </thead>\n",
|
136
|
-
" <tbody>\n",
|
137
|
-
" <tr>\n",
|
138
|
-
" <th>0</th>\n",
|
139
|
-
" <td>[deposited, paycheck, bank]</td>\n",
|
140
|
-
" <td>Financial Institution</td>\n",
|
141
|
-
" </tr>\n",
|
142
|
-
" <tr>\n",
|
143
|
-
" <th>1</th>\n",
|
144
|
-
" <td>[bank, river, eroded, heavy, rains]</td>\n",
|
145
|
-
" <td>River Border</td>\n",
|
146
|
-
" </tr>\n",
|
147
|
-
" <tr>\n",
|
148
|
-
" <th>2</th>\n",
|
149
|
-
" <td>[works, bank, teller]</td>\n",
|
150
|
-
" <td>Financial Institution</td>\n",
|
151
|
-
" </tr>\n",
|
152
|
-
" <tr>\n",
|
153
|
-
" <th>3</th>\n",
|
154
|
-
" <td>[let, 's, picnic, bank, river]</td>\n",
|
155
|
-
" <td>River Border</td>\n",
|
156
|
-
" </tr>\n",
|
157
|
-
" <tr>\n",
|
158
|
-
" <th>4</th>\n",
|
159
|
-
" <td>[bank, approved, loan, application]</td>\n",
|
160
|
-
" <td>Financial Institution</td>\n",
|
161
|
-
" </tr>\n",
|
162
|
-
" </tbody>\n",
|
163
|
-
"</table>\n",
|
164
|
-
"</div>"
|
165
|
-
],
|
166
|
-
"text/plain": [
|
167
|
-
" Sentence Class\n",
|
168
|
-
"0 [deposited, paycheck, bank] Financial Institution\n",
|
169
|
-
"1 [bank, river, eroded, heavy, rains] River Border\n",
|
170
|
-
"2 [works, bank, teller] Financial Institution\n",
|
171
|
-
"3 [let, 's, picnic, bank, river] River Border\n",
|
172
|
-
"4 [bank, approved, loan, application] Financial Institution"
|
173
|
-
]
|
174
|
-
},
|
175
|
-
"execution_count": 53,
|
176
|
-
"metadata": {},
|
177
|
-
"output_type": "execute_result"
|
178
|
-
}
|
179
|
-
],
|
180
|
-
"source": [
|
181
|
-
"for _,row in df.iterrows():\n",
|
182
|
-
" row[\"Sentence\"] = row[\"Sentence\"].lower()\n",
|
183
|
-
" row[\"Sentence\"] = word_tokenize(row[\"Sentence\"])\n",
|
184
|
-
" row[\"Sentence\"] = [i for i in row[\"Sentence\"] if i not in stops and i not in string.punctuation]\n",
|
185
|
-
"df.head()"
|
186
|
-
]
|
187
|
-
},
|
188
|
-
{
|
189
|
-
"cell_type": "code",
|
190
|
-
"execution_count": 54,
|
191
|
-
"metadata": {},
|
192
|
-
"outputs": [
|
193
|
-
{
|
194
|
-
"data": {
|
195
|
-
"text/plain": [
|
196
|
-
"[['deposited', 'paycheck', 'bank'],\n",
|
197
|
-
" ['bank', 'river', 'eroded', 'heavy', 'rains'],\n",
|
198
|
-
" ['works', 'bank', 'teller'],\n",
|
199
|
-
" ['let', \"'s\", 'picnic', 'bank', 'river'],\n",
|
200
|
-
" ['bank', 'approved', 'loan', 'application']]"
|
201
|
-
]
|
202
|
-
},
|
203
|
-
"execution_count": 54,
|
204
|
-
"metadata": {},
|
205
|
-
"output_type": "execute_result"
|
206
|
-
}
|
207
|
-
],
|
208
|
-
"source": [
|
209
|
-
"sentences = df[\"Sentence\"]\n",
|
210
|
-
"sentences = sentences.tolist()\n",
|
211
|
-
"sentences[:5]"
|
212
|
-
]
|
213
|
-
},
|
214
|
-
{
|
215
|
-
"cell_type": "code",
|
216
|
-
"execution_count": 55,
|
217
|
-
"metadata": {},
|
218
|
-
"outputs": [
|
219
|
-
{
|
220
|
-
"data": {
|
221
|
-
"text/plain": [
|
222
|
-
"['Financial Institution',\n",
|
223
|
-
" 'River Border',\n",
|
224
|
-
" 'Financial Institution',\n",
|
225
|
-
" 'River Border',\n",
|
226
|
-
" 'Financial Institution']"
|
227
|
-
]
|
228
|
-
},
|
229
|
-
"execution_count": 55,
|
230
|
-
"metadata": {},
|
231
|
-
"output_type": "execute_result"
|
232
|
-
}
|
233
|
-
],
|
234
|
-
"source": [
|
235
|
-
"classes = df[\"Class\"]\n",
|
236
|
-
"classes = classes.tolist()\n",
|
237
|
-
"classes[:5]"
|
238
|
-
]
|
239
|
-
},
|
240
|
-
{
|
241
|
-
"cell_type": "markdown",
|
242
|
-
"metadata": {},
|
243
|
-
"source": [
|
244
|
-
"## Class Frequency Counters"
|
245
|
-
]
|
246
|
-
},
|
247
|
-
{
|
248
|
-
"cell_type": "code",
|
249
|
-
"execution_count": 56,
|
250
|
-
"metadata": {},
|
251
|
-
"outputs": [],
|
252
|
-
"source": [
|
253
|
-
"from collections import defaultdict"
|
254
|
-
]
|
255
|
-
},
|
256
|
-
{
|
257
|
-
"cell_type": "code",
|
258
|
-
"execution_count": 57,
|
259
|
-
"metadata": {},
|
260
|
-
"outputs": [],
|
261
|
-
"source": [
|
262
|
-
"F_freq = defaultdict(int)\n",
|
263
|
-
"R_freq = defaultdict(int)\n",
|
264
|
-
"length = 0\n",
|
265
|
-
"F_counter = 0\n",
|
266
|
-
"R_counter = 0"
|
267
|
-
]
|
268
|
-
},
|
269
|
-
{
|
270
|
-
"cell_type": "code",
|
271
|
-
"execution_count": 58,
|
272
|
-
"metadata": {},
|
273
|
-
"outputs": [
|
274
|
-
{
|
275
|
-
"data": {
|
276
|
-
"text/plain": [
|
277
|
-
"(45, 48)"
|
278
|
-
]
|
279
|
-
},
|
280
|
-
"execution_count": 58,
|
281
|
-
"metadata": {},
|
282
|
-
"output_type": "execute_result"
|
283
|
-
}
|
284
|
-
],
|
285
|
-
"source": [
|
286
|
-
"for i in range(94):\n",
|
287
|
-
" length = length + 1\n",
|
288
|
-
" if classes[i] == \"Financial Institution\":\n",
|
289
|
-
" F_counter += 1\n",
|
290
|
-
"\n",
|
291
|
-
" for j in sentences[i]:\n",
|
292
|
-
" F_freq[j] += 1\n",
|
293
|
-
" if classes[i] == \"River Border\":\n",
|
294
|
-
" R_counter += 1\n",
|
295
|
-
"\n",
|
296
|
-
" for j in sentences[i]:\n",
|
297
|
-
" F_freq[j] += 1 \n",
|
298
|
-
"F_counter, R_counter"
|
299
|
-
]
|
300
|
-
},
|
301
|
-
{
|
302
|
-
"cell_type": "markdown",
|
303
|
-
"metadata": {},
|
304
|
-
"source": [
|
305
|
-
"### Priors"
|
306
|
-
]
|
307
|
-
},
|
308
|
-
{
|
309
|
-
"cell_type": "code",
|
310
|
-
"execution_count": 59,
|
311
|
-
"metadata": {},
|
312
|
-
"outputs": [],
|
313
|
-
"source": [
|
314
|
-
"import math"
|
315
|
-
]
|
316
|
-
},
|
317
|
-
{
|
318
|
-
"cell_type": "code",
|
319
|
-
"execution_count": 60,
|
320
|
-
"metadata": {},
|
321
|
-
"outputs": [
|
322
|
-
{
|
323
|
-
"data": {
|
324
|
-
"text/plain": [
|
325
|
-
"(-1.0473057147783567, -0.9541963103868752)"
|
326
|
-
]
|
327
|
-
},
|
328
|
-
"execution_count": 60,
|
329
|
-
"metadata": {},
|
330
|
-
"output_type": "execute_result"
|
331
|
-
}
|
332
|
-
],
|
333
|
-
"source": [
|
334
|
-
"total_classes = F_counter + R_counter\n",
|
335
|
-
"prior_fin = math.log2(F_counter/total_classes)\n",
|
336
|
-
"prior_riv = math.log2(R_counter/total_classes)\n",
|
337
|
-
"\n",
|
338
|
-
"prior_fin, prior_riv"
|
339
|
-
]
|
340
|
-
},
|
341
|
-
{
|
342
|
-
"cell_type": "code",
|
343
|
-
"execution_count": 61,
|
344
|
-
"metadata": {},
|
345
|
-
"outputs": [
|
346
|
-
{
|
347
|
-
"data": {
|
348
|
-
"text/plain": [
|
349
|
-
"255"
|
350
|
-
]
|
351
|
-
},
|
352
|
-
"execution_count": 61,
|
353
|
-
"metadata": {},
|
354
|
-
"output_type": "execute_result"
|
355
|
-
}
|
356
|
-
],
|
357
|
-
"source": [
|
358
|
-
"Vocab = set(list(F_freq.keys()) + list(R_freq.keys()))\n",
|
359
|
-
"V = len(Vocab)\n",
|
360
|
-
"V"
|
361
|
-
]
|
362
|
-
},
|
363
|
-
{
|
364
|
-
"cell_type": "markdown",
|
365
|
-
"metadata": {},
|
366
|
-
"source": [
|
367
|
-
"## Test"
|
368
|
-
]
|
369
|
-
},
|
370
|
-
{
|
371
|
-
"cell_type": "code",
|
372
|
-
"execution_count": 64,
|
373
|
-
"metadata": {},
|
374
|
-
"outputs": [
|
375
|
-
{
|
376
|
-
"data": {
|
377
|
-
"text/html": [
|
378
|
-
"<div>\n",
|
379
|
-
"<style scoped>\n",
|
380
|
-
" .dataframe tbody tr th:only-of-type {\n",
|
381
|
-
" vertical-align: middle;\n",
|
382
|
-
" }\n",
|
383
|
-
"\n",
|
384
|
-
" .dataframe tbody tr th {\n",
|
385
|
-
" vertical-align: top;\n",
|
386
|
-
" }\n",
|
387
|
-
"\n",
|
388
|
-
" .dataframe thead th {\n",
|
389
|
-
" text-align: right;\n",
|
390
|
-
" }\n",
|
391
|
-
"</style>\n",
|
392
|
-
"<table border=\"1\" class=\"dataframe\">\n",
|
393
|
-
" <thead>\n",
|
394
|
-
" <tr style=\"text-align: right;\">\n",
|
395
|
-
" <th></th>\n",
|
396
|
-
" <th>Sentence</th>\n",
|
397
|
-
" <th>Class</th>\n",
|
398
|
-
" </tr>\n",
|
399
|
-
" </thead>\n",
|
400
|
-
" <tbody>\n",
|
401
|
-
" <tr>\n",
|
402
|
-
" <th>95</th>\n",
|
403
|
-
" <td>I need to update my contact information with t...</td>\n",
|
404
|
-
" <td>?</td>\n",
|
405
|
-
" </tr>\n",
|
406
|
-
" <tr>\n",
|
407
|
-
" <th>96</th>\n",
|
408
|
-
" <td>The bank provides online banking services for ...</td>\n",
|
409
|
-
" <td>?</td>\n",
|
410
|
-
" </tr>\n",
|
411
|
-
" <tr>\n",
|
412
|
-
" <th>97</th>\n",
|
413
|
-
" <td>The beavers constructed a dam along the bank o...</td>\n",
|
414
|
-
" <td>?</td>\n",
|
415
|
-
" </tr>\n",
|
416
|
-
" <tr>\n",
|
417
|
-
" <th>98</th>\n",
|
418
|
-
" <td>I need to check my transaction history at the ...</td>\n",
|
419
|
-
" <td>?</td>\n",
|
420
|
-
" </tr>\n",
|
421
|
-
" <tr>\n",
|
422
|
-
" <th>99</th>\n",
|
423
|
-
" <td>She works as a financial consultant at the bank.</td>\n",
|
424
|
-
" <td>?</td>\n",
|
425
|
-
" </tr>\n",
|
426
|
-
" </tbody>\n",
|
427
|
-
"</table>\n",
|
428
|
-
"</div>"
|
429
|
-
],
|
430
|
-
"text/plain": [
|
431
|
-
" Sentence Class\n",
|
432
|
-
"95 I need to update my contact information with t... ?\n",
|
433
|
-
"96 The bank provides online banking services for ... ?\n",
|
434
|
-
"97 The beavers constructed a dam along the bank o... ?\n",
|
435
|
-
"98 I need to check my transaction history at the ... ?\n",
|
436
|
-
"99 She works as a financial consultant at the bank. ?"
|
437
|
-
]
|
438
|
-
},
|
439
|
-
"execution_count": 64,
|
440
|
-
"metadata": {},
|
441
|
-
"output_type": "execute_result"
|
442
|
-
}
|
443
|
-
],
|
444
|
-
"source": [
|
445
|
-
"df = pd.read_csv(\"../Bank.csv\")\n",
|
446
|
-
"test = df.iloc[95:, :]\n",
|
447
|
-
"test.head()"
|
448
|
-
]
|
449
|
-
},
|
450
|
-
{
|
451
|
-
"cell_type": "code",
|
452
|
-
"execution_count": 67,
|
453
|
-
"metadata": {},
|
454
|
-
"outputs": [
|
455
|
-
{
|
456
|
-
"data": {
|
457
|
-
"text/html": [
|
458
|
-
"<div>\n",
|
459
|
-
"<style scoped>\n",
|
460
|
-
" .dataframe tbody tr th:only-of-type {\n",
|
461
|
-
" vertical-align: middle;\n",
|
462
|
-
" }\n",
|
463
|
-
"\n",
|
464
|
-
" .dataframe tbody tr th {\n",
|
465
|
-
" vertical-align: top;\n",
|
466
|
-
" }\n",
|
467
|
-
"\n",
|
468
|
-
" .dataframe thead th {\n",
|
469
|
-
" text-align: right;\n",
|
470
|
-
" }\n",
|
471
|
-
"</style>\n",
|
472
|
-
"<table border=\"1\" class=\"dataframe\">\n",
|
473
|
-
" <thead>\n",
|
474
|
-
" <tr style=\"text-align: right;\">\n",
|
475
|
-
" <th></th>\n",
|
476
|
-
" <th>Sentence</th>\n",
|
477
|
-
" <th>Class</th>\n",
|
478
|
-
" </tr>\n",
|
479
|
-
" </thead>\n",
|
480
|
-
" <tbody>\n",
|
481
|
-
" <tr>\n",
|
482
|
-
" <th>95</th>\n",
|
483
|
-
" <td>[need, update, contact, information, bank]</td>\n",
|
484
|
-
" <td>?</td>\n",
|
485
|
-
" </tr>\n",
|
486
|
-
" <tr>\n",
|
487
|
-
" <th>96</th>\n",
|
488
|
-
" <td>[bank, provides, online, banking, services, co...</td>\n",
|
489
|
-
" <td>?</td>\n",
|
490
|
-
" </tr>\n",
|
491
|
-
" <tr>\n",
|
492
|
-
" <th>97</th>\n",
|
493
|
-
" <td>[beavers, constructed, dam, along, bank, river]</td>\n",
|
494
|
-
" <td>?</td>\n",
|
495
|
-
" </tr>\n",
|
496
|
-
" <tr>\n",
|
497
|
-
" <th>98</th>\n",
|
498
|
-
" <td>[need, check, transaction, history, bank]</td>\n",
|
499
|
-
" <td>?</td>\n",
|
500
|
-
" </tr>\n",
|
501
|
-
" <tr>\n",
|
502
|
-
" <th>99</th>\n",
|
503
|
-
" <td>[works, financial, consultant, bank]</td>\n",
|
504
|
-
" <td>?</td>\n",
|
505
|
-
" </tr>\n",
|
506
|
-
" </tbody>\n",
|
507
|
-
"</table>\n",
|
508
|
-
"</div>"
|
509
|
-
],
|
510
|
-
"text/plain": [
|
511
|
-
" Sentence Class\n",
|
512
|
-
"95 [need, update, contact, information, bank] ?\n",
|
513
|
-
"96 [bank, provides, online, banking, services, co... ?\n",
|
514
|
-
"97 [beavers, constructed, dam, along, bank, river] ?\n",
|
515
|
-
"98 [need, check, transaction, history, bank] ?\n",
|
516
|
-
"99 [works, financial, consultant, bank] ?"
|
517
|
-
]
|
518
|
-
},
|
519
|
-
"execution_count": 67,
|
520
|
-
"metadata": {},
|
521
|
-
"output_type": "execute_result"
|
522
|
-
}
|
523
|
-
],
|
524
|
-
"source": [
|
525
|
-
"for _,row in test.iterrows():\n",
|
526
|
-
" row[\"Sentence\"] = row[\"Sentence\"].lower()\n",
|
527
|
-
" row[\"Sentence\"] = word_tokenize(row[\"Sentence\"])\n",
|
528
|
-
" row[\"Sentence\"] = [i for i in row[\"Sentence\"] if i not in stops and i not in string.punctuation]\n",
|
529
|
-
"test.head()"
|
530
|
-
]
|
531
|
-
},
|
532
|
-
{
|
533
|
-
"cell_type": "code",
|
534
|
-
"execution_count": 78,
|
535
|
-
"metadata": {},
|
536
|
-
"outputs": [
|
537
|
-
{
|
538
|
-
"data": {
|
539
|
-
"text/html": [
|
540
|
-
"<div>\n",
|
541
|
-
"<style scoped>\n",
|
542
|
-
" .dataframe tbody tr th:only-of-type {\n",
|
543
|
-
" vertical-align: middle;\n",
|
544
|
-
" }\n",
|
545
|
-
"\n",
|
546
|
-
" .dataframe tbody tr th {\n",
|
547
|
-
" vertical-align: top;\n",
|
548
|
-
" }\n",
|
549
|
-
"\n",
|
550
|
-
" .dataframe thead th {\n",
|
551
|
-
" text-align: right;\n",
|
552
|
-
" }\n",
|
553
|
-
"</style>\n",
|
554
|
-
"<table border=\"1\" class=\"dataframe\">\n",
|
555
|
-
" <thead>\n",
|
556
|
-
" <tr style=\"text-align: right;\">\n",
|
557
|
-
" <th></th>\n",
|
558
|
-
" <th>Sentence</th>\n",
|
559
|
-
" <th>Class</th>\n",
|
560
|
-
" </tr>\n",
|
561
|
-
" </thead>\n",
|
562
|
-
" <tbody>\n",
|
563
|
-
" <tr>\n",
|
564
|
-
" <th>95</th>\n",
|
565
|
-
" <td>[need, update, contact, information, bank]</td>\n",
|
566
|
-
" <td>Financial Institution</td>\n",
|
567
|
-
" </tr>\n",
|
568
|
-
" <tr>\n",
|
569
|
-
" <th>96</th>\n",
|
570
|
-
" <td>[bank, provides, online, banking, services, co...</td>\n",
|
571
|
-
" <td>Financial Institution</td>\n",
|
572
|
-
" </tr>\n",
|
573
|
-
" <tr>\n",
|
574
|
-
" <th>97</th>\n",
|
575
|
-
" <td>[beavers, constructed, dam, along, bank, river]</td>\n",
|
576
|
-
" <td>Financial Institution</td>\n",
|
577
|
-
" </tr>\n",
|
578
|
-
" <tr>\n",
|
579
|
-
" <th>98</th>\n",
|
580
|
-
" <td>[need, check, transaction, history, bank]</td>\n",
|
581
|
-
" <td>Financial Institution</td>\n",
|
582
|
-
" </tr>\n",
|
583
|
-
" <tr>\n",
|
584
|
-
" <th>99</th>\n",
|
585
|
-
" <td>[works, financial, consultant, bank]</td>\n",
|
586
|
-
" <td>Financial Institution</td>\n",
|
587
|
-
" </tr>\n",
|
588
|
-
" </tbody>\n",
|
589
|
-
"</table>\n",
|
590
|
-
"</div>"
|
591
|
-
],
|
592
|
-
"text/plain": [
|
593
|
-
" Sentence Class\n",
|
594
|
-
"95 [need, update, contact, information, bank] Financial Institution\n",
|
595
|
-
"96 [bank, provides, online, banking, services, co... Financial Institution\n",
|
596
|
-
"97 [beavers, constructed, dam, along, bank, river] Financial Institution\n",
|
597
|
-
"98 [need, check, transaction, history, bank] Financial Institution\n",
|
598
|
-
"99 [works, financial, consultant, bank] Financial Institution"
|
599
|
-
]
|
600
|
-
},
|
601
|
-
"execution_count": 78,
|
602
|
-
"metadata": {},
|
603
|
-
"output_type": "execute_result"
|
604
|
-
}
|
605
|
-
],
|
606
|
-
"source": [
|
607
|
-
"for _, row in test.iterrows():\n",
|
608
|
-
" score_fin = prior_fin\n",
|
609
|
-
" score_riv = prior_riv\n",
|
610
|
-
"\n",
|
611
|
-
" for token in row[\"Sentence\"]:\n",
|
612
|
-
" score_fin += math.log2(F_freq[token] + 1) - math.log2(F_counter + V)\n",
|
613
|
-
" score_riv += math.log2(R_freq[token] + 1) - math.log2(R_counter + V)\n",
|
614
|
-
"\n",
|
615
|
-
" if score_fin > score_riv:\n",
|
616
|
-
" row[\"Class\"] = \"Financial Institution\"\n",
|
617
|
-
" else:\n",
|
618
|
-
" row[\"Class\"] = \"River Border\"\n",
|
619
|
-
"\n",
|
620
|
-
"test"
|
621
|
-
]
|
622
|
-
}
|
623
|
-
],
|
624
|
-
"metadata": {
|
625
|
-
"kernelspec": {
|
626
|
-
"display_name": "Python 3",
|
627
|
-
"language": "python",
|
628
|
-
"name": "python3"
|
629
|
-
},
|
630
|
-
"language_info": {
|
631
|
-
"codemirror_mode": {
|
632
|
-
"name": "ipython",
|
633
|
-
"version": 3
|
634
|
-
},
|
635
|
-
"file_extension": ".py",
|
636
|
-
"mimetype": "text/x-python",
|
637
|
-
"name": "python",
|
638
|
-
"nbconvert_exporter": "python",
|
639
|
-
"pygments_lexer": "ipython3",
|
640
|
-
"version": "3.12.7"
|
641
|
-
}
|
642
|
-
},
|
643
|
-
"nbformat": 4,
|
644
|
-
"nbformat_minor": 2
|
645
|
-
}
|