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,383 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "markdown",
|
5
|
-
"id": "b624a9ba-0ae8-4c87-ae4c-476684d7e101",
|
6
|
-
"metadata": {},
|
7
|
-
"source": [
|
8
|
-
"# Implement Probabilistic Context Free Grammar (PCFG) and find the inside probability of a word sequence using the CYK algorithm."
|
9
|
-
]
|
10
|
-
},
|
11
|
-
{
|
12
|
-
"cell_type": "code",
|
13
|
-
"execution_count": 21,
|
14
|
-
"id": "a0748f9b-182a-42ac-847e-265497da12ad",
|
15
|
-
"metadata": {},
|
16
|
-
"outputs": [
|
17
|
-
{
|
18
|
-
"name": "stdin",
|
19
|
-
"output_type": "stream",
|
20
|
-
"text": [
|
21
|
-
"Enter the number of rules : 12\n",
|
22
|
-
"TAG 1 : S\n",
|
23
|
-
"RULE : NP VP\n",
|
24
|
-
"PROPABILITY : 1.0\n"
|
25
|
-
]
|
26
|
-
},
|
27
|
-
{
|
28
|
-
"name": "stdout",
|
29
|
-
"output_type": "stream",
|
30
|
-
"text": [
|
31
|
-
"\n"
|
32
|
-
]
|
33
|
-
},
|
34
|
-
{
|
35
|
-
"name": "stdin",
|
36
|
-
"output_type": "stream",
|
37
|
-
"text": [
|
38
|
-
"TAG 2 : PP\n",
|
39
|
-
"RULE : P NP\n",
|
40
|
-
"PROPABILITY : 1.0\n"
|
41
|
-
]
|
42
|
-
},
|
43
|
-
{
|
44
|
-
"name": "stdout",
|
45
|
-
"output_type": "stream",
|
46
|
-
"text": [
|
47
|
-
"\n"
|
48
|
-
]
|
49
|
-
},
|
50
|
-
{
|
51
|
-
"name": "stdin",
|
52
|
-
"output_type": "stream",
|
53
|
-
"text": [
|
54
|
-
"TAG 3 : VP\n",
|
55
|
-
"RULE : V NP\n",
|
56
|
-
"PROPABILITY : 0.7\n"
|
57
|
-
]
|
58
|
-
},
|
59
|
-
{
|
60
|
-
"name": "stdout",
|
61
|
-
"output_type": "stream",
|
62
|
-
"text": [
|
63
|
-
"\n"
|
64
|
-
]
|
65
|
-
},
|
66
|
-
{
|
67
|
-
"name": "stdin",
|
68
|
-
"output_type": "stream",
|
69
|
-
"text": [
|
70
|
-
"TAG 4 : VP\n",
|
71
|
-
"RULE : VP PP\n",
|
72
|
-
"PROPABILITY : 0.3\n"
|
73
|
-
]
|
74
|
-
},
|
75
|
-
{
|
76
|
-
"name": "stdout",
|
77
|
-
"output_type": "stream",
|
78
|
-
"text": [
|
79
|
-
"\n"
|
80
|
-
]
|
81
|
-
},
|
82
|
-
{
|
83
|
-
"name": "stdin",
|
84
|
-
"output_type": "stream",
|
85
|
-
"text": [
|
86
|
-
"TAG 5 : P\n",
|
87
|
-
"RULE : WITH\n",
|
88
|
-
"PROPABILITY : 1.0\n"
|
89
|
-
]
|
90
|
-
},
|
91
|
-
{
|
92
|
-
"name": "stdout",
|
93
|
-
"output_type": "stream",
|
94
|
-
"text": [
|
95
|
-
"\n"
|
96
|
-
]
|
97
|
-
},
|
98
|
-
{
|
99
|
-
"name": "stdin",
|
100
|
-
"output_type": "stream",
|
101
|
-
"text": [
|
102
|
-
"TAG 6 : V\n",
|
103
|
-
"RULE : SAW\n",
|
104
|
-
"PROPABILITY : 1.0\n"
|
105
|
-
]
|
106
|
-
},
|
107
|
-
{
|
108
|
-
"name": "stdout",
|
109
|
-
"output_type": "stream",
|
110
|
-
"text": [
|
111
|
-
"\n"
|
112
|
-
]
|
113
|
-
},
|
114
|
-
{
|
115
|
-
"name": "stdin",
|
116
|
-
"output_type": "stream",
|
117
|
-
"text": [
|
118
|
-
"TAG 7 : NP\n",
|
119
|
-
"RULE : NP PP\n",
|
120
|
-
"PROPABILITY : 0.4\n"
|
121
|
-
]
|
122
|
-
},
|
123
|
-
{
|
124
|
-
"name": "stdout",
|
125
|
-
"output_type": "stream",
|
126
|
-
"text": [
|
127
|
-
"\n"
|
128
|
-
]
|
129
|
-
},
|
130
|
-
{
|
131
|
-
"name": "stdin",
|
132
|
-
"output_type": "stream",
|
133
|
-
"text": [
|
134
|
-
"TAG 8 : NP\n",
|
135
|
-
"RULE : ASTRONOMERS\n",
|
136
|
-
"PROPABILITY : 0.1\n"
|
137
|
-
]
|
138
|
-
},
|
139
|
-
{
|
140
|
-
"name": "stdout",
|
141
|
-
"output_type": "stream",
|
142
|
-
"text": [
|
143
|
-
"\n"
|
144
|
-
]
|
145
|
-
},
|
146
|
-
{
|
147
|
-
"name": "stdin",
|
148
|
-
"output_type": "stream",
|
149
|
-
"text": [
|
150
|
-
"TAG 9 : NP\n",
|
151
|
-
"RULE : EARS\n",
|
152
|
-
"PROPABILITY : 0.18\n"
|
153
|
-
]
|
154
|
-
},
|
155
|
-
{
|
156
|
-
"name": "stdout",
|
157
|
-
"output_type": "stream",
|
158
|
-
"text": [
|
159
|
-
"\n"
|
160
|
-
]
|
161
|
-
},
|
162
|
-
{
|
163
|
-
"name": "stdin",
|
164
|
-
"output_type": "stream",
|
165
|
-
"text": [
|
166
|
-
"TAG 10 : NP\n",
|
167
|
-
"RULE : SAW\n",
|
168
|
-
"PROPABILITY : 0.04\n"
|
169
|
-
]
|
170
|
-
},
|
171
|
-
{
|
172
|
-
"name": "stdout",
|
173
|
-
"output_type": "stream",
|
174
|
-
"text": [
|
175
|
-
"\n"
|
176
|
-
]
|
177
|
-
},
|
178
|
-
{
|
179
|
-
"name": "stdin",
|
180
|
-
"output_type": "stream",
|
181
|
-
"text": [
|
182
|
-
"TAG 11 : NP\n",
|
183
|
-
"RULE : STARS\n",
|
184
|
-
"PROPABILITY : 0.18\n"
|
185
|
-
]
|
186
|
-
},
|
187
|
-
{
|
188
|
-
"name": "stdout",
|
189
|
-
"output_type": "stream",
|
190
|
-
"text": [
|
191
|
-
"\n"
|
192
|
-
]
|
193
|
-
},
|
194
|
-
{
|
195
|
-
"name": "stdin",
|
196
|
-
"output_type": "stream",
|
197
|
-
"text": [
|
198
|
-
"TAG 12 : NP\n",
|
199
|
-
"RULE : TELESCOPE\n",
|
200
|
-
"PROPABILITY : 0.1\n"
|
201
|
-
]
|
202
|
-
},
|
203
|
-
{
|
204
|
-
"name": "stdout",
|
205
|
-
"output_type": "stream",
|
206
|
-
"text": [
|
207
|
-
"\n"
|
208
|
-
]
|
209
|
-
}
|
210
|
-
],
|
211
|
-
"source": [
|
212
|
-
"num = int(input(\"Enter the number of rules : \"))\n",
|
213
|
-
"PCFG = {}\n",
|
214
|
-
"for i in range(num) :\n",
|
215
|
-
" tag = input(f\"TAG {i+1} : \").upper()\n",
|
216
|
-
" rule = input(f\"RULE : \").upper()\n",
|
217
|
-
" prop = float(input(f\"PROPABILITY : \"))\n",
|
218
|
-
" print()\n",
|
219
|
-
" if tag in PCFG :\n",
|
220
|
-
" PCFG[tag].append((rule, prop))\n",
|
221
|
-
" else :\n",
|
222
|
-
" PCFG[tag] = [(rule, prop)]\n",
|
223
|
-
" "
|
224
|
-
]
|
225
|
-
},
|
226
|
-
{
|
227
|
-
"cell_type": "code",
|
228
|
-
"execution_count": 22,
|
229
|
-
"id": "f811e0cd-554c-4149-ab46-4ee4abe8150d",
|
230
|
-
"metadata": {},
|
231
|
-
"outputs": [
|
232
|
-
{
|
233
|
-
"name": "stdin",
|
234
|
-
"output_type": "stream",
|
235
|
-
"text": [
|
236
|
-
"Enter the Word Sequence : ASTRONOMERS SAW STARS WITH EARS\n"
|
237
|
-
]
|
238
|
-
}
|
239
|
-
],
|
240
|
-
"source": [
|
241
|
-
"word_seq = input(\"Enter the Word Sequence : \").upper().split(' ')"
|
242
|
-
]
|
243
|
-
},
|
244
|
-
{
|
245
|
-
"cell_type": "code",
|
246
|
-
"execution_count": 35,
|
247
|
-
"id": "803ea9fe-2905-4fc2-aafb-75156645b579",
|
248
|
-
"metadata": {},
|
249
|
-
"outputs": [],
|
250
|
-
"source": [
|
251
|
-
"def CYK(word_seq, PCFG) :\n",
|
252
|
-
" PI = [[{} for _ in range(len(word_seq))] for _ in range(len(word_seq))]\n",
|
253
|
-
" BOOK = [[{} for _ in range(len(word_seq))] for _ in range(len(word_seq))]\n",
|
254
|
-
" for i in range(len(word_seq)) :\n",
|
255
|
-
" for tag, rule_list in PCFG.items() :\n",
|
256
|
-
" for rule, prop in rule_list :\n",
|
257
|
-
" if rule == word_seq[i] :\n",
|
258
|
-
" PI[i][i][tag] = prop\n",
|
259
|
-
" BOOK[i][i][tag] = word_seq[i]\n",
|
260
|
-
" \n",
|
261
|
-
"\n",
|
262
|
-
" l = len(word_seq)\n",
|
263
|
-
" for c in range(1, l) :\n",
|
264
|
-
" for i in range(0, l-c) :\n",
|
265
|
-
" j = i + c\n",
|
266
|
-
" for m in range(i, j) :\n",
|
267
|
-
" for rule1 in PI[i][m] :\n",
|
268
|
-
" for rule2 in PI[m+1][j] :\n",
|
269
|
-
" entry = rule1 + \" \" + rule2\n",
|
270
|
-
" for tag, rule_list in PCFG.items() :\n",
|
271
|
-
" for rule, prop in rule_list :\n",
|
272
|
-
" if rule == entry :\n",
|
273
|
-
" val = prop*PI[i][m][rule1]*PI[m+1][j][rule2]\n",
|
274
|
-
" if tag in PI[i][j] :\n",
|
275
|
-
" PI[i][j][tag] += val\n",
|
276
|
-
" BOOK[i][j][tag] += [(rule, m)]\n",
|
277
|
-
" else :\n",
|
278
|
-
" PI[i][j][tag] = val\n",
|
279
|
-
" BOOK[i][j][tag] = [(rule, m)]\n",
|
280
|
-
"\n",
|
281
|
-
" return PI, BOOK\n",
|
282
|
-
" \n",
|
283
|
-
" \n",
|
284
|
-
" "
|
285
|
-
]
|
286
|
-
},
|
287
|
-
{
|
288
|
-
"cell_type": "code",
|
289
|
-
"execution_count": 36,
|
290
|
-
"id": "d52f8d91-260c-49c8-a63e-f378f8dd5698",
|
291
|
-
"metadata": {},
|
292
|
-
"outputs": [
|
293
|
-
{
|
294
|
-
"name": "stdout",
|
295
|
-
"output_type": "stream",
|
296
|
-
"text": [
|
297
|
-
"[{'NP': 0.1}, {}, {'S': 0.0126}, {}, {'S': 0.0015875999999999998}]\n",
|
298
|
-
"[{}, {'V': 1.0, 'NP': 0.04}, {'VP': 0.126}, {}, {'VP': 0.015875999999999998}]\n",
|
299
|
-
"[{}, {}, {'NP': 0.18}, {}, {'NP': 0.01296}]\n",
|
300
|
-
"[{}, {}, {}, {'P': 1.0}, {'PP': 0.18}]\n",
|
301
|
-
"[{}, {}, {}, {}, {'NP': 0.18}]\n"
|
302
|
-
]
|
303
|
-
}
|
304
|
-
],
|
305
|
-
"source": [
|
306
|
-
"PI, BOOK = CYK(word_seq, PCFG)\n",
|
307
|
-
"for row in PI :\n",
|
308
|
-
" print(row)"
|
309
|
-
]
|
310
|
-
},
|
311
|
-
{
|
312
|
-
"cell_type": "code",
|
313
|
-
"execution_count": 37,
|
314
|
-
"id": "7ec3e635-9e33-469f-975b-88d0c6236ddb",
|
315
|
-
"metadata": {},
|
316
|
-
"outputs": [
|
317
|
-
{
|
318
|
-
"name": "stdout",
|
319
|
-
"output_type": "stream",
|
320
|
-
"text": [
|
321
|
-
"Propability of the given word sequence : {'S': 0.0015875999999999998}\n"
|
322
|
-
]
|
323
|
-
}
|
324
|
-
],
|
325
|
-
"source": [
|
326
|
-
"n = len(word_seq)\n",
|
327
|
-
"print(f\"Propability of the given word sequence : {PI[0][n-1]}\")"
|
328
|
-
]
|
329
|
-
},
|
330
|
-
{
|
331
|
-
"cell_type": "code",
|
332
|
-
"execution_count": 38,
|
333
|
-
"id": "07c3e3d9-70be-433c-be83-97d004c258d9",
|
334
|
-
"metadata": {},
|
335
|
-
"outputs": [
|
336
|
-
{
|
337
|
-
"name": "stdout",
|
338
|
-
"output_type": "stream",
|
339
|
-
"text": [
|
340
|
-
"[{'NP': 'ASTRONOMERS'}, {}, {'S': [('NP VP', 0)]}, {}, {'S': [('NP VP', 0)]}]\n",
|
341
|
-
"[{}, {'V': 'SAW', 'NP': 'SAW'}, {'VP': [('V NP', 1)]}, {}, {'VP': [('V NP', 1), ('VP PP', 2)]}]\n",
|
342
|
-
"[{}, {}, {'NP': 'STARS'}, {}, {'NP': [('NP PP', 2)]}]\n",
|
343
|
-
"[{}, {}, {}, {'P': 'WITH'}, {'PP': [('P NP', 3)]}]\n",
|
344
|
-
"[{}, {}, {}, {}, {'NP': 'EARS'}]\n"
|
345
|
-
]
|
346
|
-
}
|
347
|
-
],
|
348
|
-
"source": [
|
349
|
-
"for row in BOOK :\n",
|
350
|
-
" print(row)"
|
351
|
-
]
|
352
|
-
},
|
353
|
-
{
|
354
|
-
"cell_type": "code",
|
355
|
-
"execution_count": null,
|
356
|
-
"id": "a92dbc9f-1e5b-4370-9f73-5105f09b89d7",
|
357
|
-
"metadata": {},
|
358
|
-
"outputs": [],
|
359
|
-
"source": []
|
360
|
-
}
|
361
|
-
],
|
362
|
-
"metadata": {
|
363
|
-
"kernelspec": {
|
364
|
-
"display_name": "Python 3 (ipykernel)",
|
365
|
-
"language": "python",
|
366
|
-
"name": "python3"
|
367
|
-
},
|
368
|
-
"language_info": {
|
369
|
-
"codemirror_mode": {
|
370
|
-
"name": "ipython",
|
371
|
-
"version": 3
|
372
|
-
},
|
373
|
-
"file_extension": ".py",
|
374
|
-
"mimetype": "text/x-python",
|
375
|
-
"name": "python",
|
376
|
-
"nbconvert_exporter": "python",
|
377
|
-
"pygments_lexer": "ipython3",
|
378
|
-
"version": "3.11.1"
|
379
|
-
}
|
380
|
-
},
|
381
|
-
"nbformat": 4,
|
382
|
-
"nbformat_minor": 5
|
383
|
-
}
|
@@ -1,252 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"cells": [
|
3
|
-
{
|
4
|
-
"cell_type": "code",
|
5
|
-
"execution_count": 8,
|
6
|
-
"id": "a5300496-5a71-44c4-968a-df705d3b87dd",
|
7
|
-
"metadata": {},
|
8
|
-
"outputs": [],
|
9
|
-
"source": [
|
10
|
-
"import pandas as pd\n",
|
11
|
-
"import numpy as np\n",
|
12
|
-
"from sklearn.model_selection import train_test_split\n",
|
13
|
-
"from sklearn.feature_extraction.text import CountVectorizer,TfidfVectorizer\n",
|
14
|
-
"from sklearn.preprocessing import LabelEncoder\n",
|
15
|
-
"import tensorflow as tf\n",
|
16
|
-
"from tensorflow.keras import Sequential\n",
|
17
|
-
"from tensorflow.keras.layers import Dense"
|
18
|
-
]
|
19
|
-
},
|
20
|
-
{
|
21
|
-
"cell_type": "code",
|
22
|
-
"execution_count": 9,
|
23
|
-
"id": "bb5c905b-ee46-474c-b994-2dc9cfd39d39",
|
24
|
-
"metadata": {},
|
25
|
-
"outputs": [],
|
26
|
-
"source": [
|
27
|
-
"data = {'text': ['I love programming', 'Python is great', 'I enjoy machine learning',\n",
|
28
|
-
" 'TensorFlow is a powerful tool', 'AI is the future'],\n",
|
29
|
-
" 'label': ['positive', 'positive', 'positive', 'positive', 'neutral']}\n",
|
30
|
-
"df = pd.DataFrame(data)\n",
|
31
|
-
"labelencoder = LabelEncoder()\n",
|
32
|
-
"df['label'] = labelencoder.fit_transform(df['label'])\n",
|
33
|
-
"x_train,x_test,y_train,y_test = train_test_split(df['text'],df['label'],test_size=0.2,random_state=42)"
|
34
|
-
]
|
35
|
-
},
|
36
|
-
{
|
37
|
-
"cell_type": "code",
|
38
|
-
"execution_count": 12,
|
39
|
-
"id": "cf62ab92-aae6-487c-a39d-dcbd9faa0b39",
|
40
|
-
"metadata": {},
|
41
|
-
"outputs": [
|
42
|
-
{
|
43
|
-
"name": "stdout",
|
44
|
-
"output_type": "stream",
|
45
|
-
"text": [
|
46
|
-
"Training with Bag of words\n",
|
47
|
-
"Epoch 1/10\n"
|
48
|
-
]
|
49
|
-
},
|
50
|
-
{
|
51
|
-
"name": "stderr",
|
52
|
-
"output_type": "stream",
|
53
|
-
"text": [
|
54
|
-
"C:\\Users\\BHARATH.K\\AppData\\Local\\Programs\\Python\\Python312\\Lib\\site-packages\\keras\\src\\layers\\core\\dense.py:87: UserWarning: Do not pass an `input_shape`/`input_dim` argument to a layer. When using Sequential models, prefer using an `Input(shape)` object as the first layer in the model instead.\n",
|
55
|
-
" super().__init__(activity_regularizer=activity_regularizer, **kwargs)\n"
|
56
|
-
]
|
57
|
-
},
|
58
|
-
{
|
59
|
-
"name": "stdout",
|
60
|
-
"output_type": "stream",
|
61
|
-
"text": [
|
62
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 12ms/step - accuracy: 0.1667 - loss: 0.7754 \n",
|
63
|
-
"Epoch 2/10\n",
|
64
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - accuracy: 0.1667 - loss: 0.7541 \n",
|
65
|
-
"Epoch 3/10\n",
|
66
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - accuracy: 0.3333 - loss: 0.7022 \n",
|
67
|
-
"Epoch 4/10\n",
|
68
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - accuracy: 0.3333 - loss: 0.6927 \n",
|
69
|
-
"Epoch 5/10\n",
|
70
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - accuracy: 0.3333 - loss: 0.6833 \n",
|
71
|
-
"Epoch 6/10\n",
|
72
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - accuracy: 0.1667 - loss: 0.7077 \n",
|
73
|
-
"Epoch 7/10\n",
|
74
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 6ms/step - accuracy: 0.3333 - loss: 0.6650 \n",
|
75
|
-
"Epoch 8/10\n",
|
76
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - accuracy: 0.5000 - loss: 0.6935 \n",
|
77
|
-
"Epoch 9/10\n",
|
78
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - accuracy: 0.3333 - loss: 0.6888 \n",
|
79
|
-
"Epoch 10/10\n",
|
80
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - accuracy: 0.5000 - loss: 0.6398 \n",
|
81
|
-
"\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 195ms/step - accuracy: 0.0000e+00 - loss: 0.8297\n",
|
82
|
-
"BOW model accuracy:0.0\n",
|
83
|
-
"Training with TF-IDF\n",
|
84
|
-
"Epoch 1/10\n",
|
85
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m1s\u001b[0m 5ms/step - accuracy: 0.3333 - loss: 0.7194\n",
|
86
|
-
"Epoch 2/10\n",
|
87
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - accuracy: 0.3333 - loss: 0.6764 \n",
|
88
|
-
"Epoch 3/10\n",
|
89
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 8ms/step - accuracy: 0.1667 - loss: 0.7094 \n",
|
90
|
-
"Epoch 4/10\n",
|
91
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 6ms/step - accuracy: 0.5000 - loss: 0.7018 \n",
|
92
|
-
"Epoch 5/10\n",
|
93
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - accuracy: 0.6667 - loss: 0.6567 \n",
|
94
|
-
"Epoch 6/10\n",
|
95
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 6ms/step - accuracy: 0.5000 - loss: 0.7085 \n",
|
96
|
-
"Epoch 7/10\n",
|
97
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - accuracy: 0.5000 - loss: 0.6754 \n",
|
98
|
-
"Epoch 8/10\n",
|
99
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - accuracy: 0.3333 - loss: 0.7031 \n",
|
100
|
-
"Epoch 9/10\n",
|
101
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 6ms/step - accuracy: 0.6667 - loss: 0.6347 \n",
|
102
|
-
"Epoch 10/10\n",
|
103
|
-
"\u001b[1m2/2\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 7ms/step - accuracy: 0.5000 - loss: 0.6415 \n"
|
104
|
-
]
|
105
|
-
},
|
106
|
-
{
|
107
|
-
"data": {
|
108
|
-
"text/plain": [
|
109
|
-
"<keras.src.callbacks.history.History at 0x1d2600a15b0>"
|
110
|
-
]
|
111
|
-
},
|
112
|
-
"execution_count": 12,
|
113
|
-
"metadata": {},
|
114
|
-
"output_type": "execute_result"
|
115
|
-
}
|
116
|
-
],
|
117
|
-
"source": [
|
118
|
-
"vectorizer_bow = CountVectorizer()\n",
|
119
|
-
"x_train_bow = vectorizer_bow.fit_transform(x_train).toarray()\n",
|
120
|
-
"x_test_bow = vectorizer_bow.transform(x_test).toarray()\n",
|
121
|
-
"\n",
|
122
|
-
"vectorizer_tfidf = TfidfVectorizer()\n",
|
123
|
-
"x_train_tfidf = vectorizer_tfidf.fit_transform(x_train).toarray()\n",
|
124
|
-
"x_test_tfidf = vectorizer_tfidf.transform(x_test).toarray()\n",
|
125
|
-
"\n",
|
126
|
-
"def build_model(input_dim):\n",
|
127
|
-
" model = Sequential()\n",
|
128
|
-
" model.add(Dense(16,activation='relu',input_dim=input_dim))\n",
|
129
|
-
" model.add(Dense(8,activation='relu'))\n",
|
130
|
-
" model.add(Dense(1,activation='sigmoid'))\n",
|
131
|
-
" model.compile(optimizer='adam',loss='binary_crossentropy',metrics=['accuracy'])\n",
|
132
|
-
" return model\n",
|
133
|
-
"\n",
|
134
|
-
"print(\"Training with Bag of words\")\n",
|
135
|
-
"model_bow = build_model(x_train_bow.shape[1])\n",
|
136
|
-
"model_bow.fit(x_train_bow,y_train,epochs=10,batch_size=2,verbose=1)\n",
|
137
|
-
"loss,accuracy = model_bow.evaluate(x_test_bow,y_test)\n",
|
138
|
-
"\n",
|
139
|
-
"print(f\"BOW model accuracy:{accuracy}\")\n",
|
140
|
-
"\n",
|
141
|
-
"print(\"Training with TF-IDF\")\n",
|
142
|
-
"model_tfidf = build_model(x_train_tfidf.shape[1])\n",
|
143
|
-
"model_tfidf.fit(x_train_tfidf,y_train,epochs=10,batch_size=2,verbose=1)"
|
144
|
-
]
|
145
|
-
},
|
146
|
-
{
|
147
|
-
"cell_type": "code",
|
148
|
-
"execution_count": 15,
|
149
|
-
"id": "8dd3cb94-1fef-46a5-aeba-21ab61a92310",
|
150
|
-
"metadata": {},
|
151
|
-
"outputs": [
|
152
|
-
{
|
153
|
-
"name": "stdout",
|
154
|
-
"output_type": "stream",
|
155
|
-
"text": [
|
156
|
-
"\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 27ms/step\n",
|
157
|
-
"BOW predictions: [[0.50319755]\n",
|
158
|
-
" [0.4361956 ]\n",
|
159
|
-
" [0.5179436 ]\n",
|
160
|
-
" [0.4758614 ]\n",
|
161
|
-
" [0.40164202]]\n",
|
162
|
-
"\u001b[1m1/1\u001b[0m \u001b[32m━━━━━━━━━━━━━━━━━━━━\u001b[0m\u001b[37m\u001b[0m \u001b[1m0s\u001b[0m 30ms/step\n",
|
163
|
-
"TF-IDF predictions: [[0.5335882 ]\n",
|
164
|
-
" [0.5208615 ]\n",
|
165
|
-
" [0.49639997]\n",
|
166
|
-
" [0.46454915]\n",
|
167
|
-
" [0.4026386 ]]\n"
|
168
|
-
]
|
169
|
-
}
|
170
|
-
],
|
171
|
-
"source": [
|
172
|
-
"data_bow = vectorizer_bow.transform(data['text']).toarray()\n",
|
173
|
-
"data_bow_predictions = model_bow.predict(data_bow)\n",
|
174
|
-
"print(\"BOW predictions:\",data_bow_predictions)\n",
|
175
|
-
"\n",
|
176
|
-
"data_tfidf = vectorizer_tfidf.transform(data['text']).toarray()\n",
|
177
|
-
"data_tfidf_predictions = model_tfidf.predict(data_tfidf)\n",
|
178
|
-
"print(\"TF-IDF predictions:\",data_tfidf_predictions)"
|
179
|
-
]
|
180
|
-
},
|
181
|
-
{
|
182
|
-
"cell_type": "code",
|
183
|
-
"execution_count": 17,
|
184
|
-
"id": "8b8826c3-0e4e-4e42-932a-3656c6895bd9",
|
185
|
-
"metadata": {},
|
186
|
-
"outputs": [
|
187
|
-
{
|
188
|
-
"name": "stdout",
|
189
|
-
"output_type": "stream",
|
190
|
-
"text": [
|
191
|
-
"['positive', 'neutral', 'positive', 'neutral', 'neutral']\n"
|
192
|
-
]
|
193
|
-
}
|
194
|
-
],
|
195
|
-
"source": [
|
196
|
-
" threshold=0.5\n",
|
197
|
-
"predictions_bow_label =['positive' if p >= threshold else 'neutral' for p in data_bow_predictions] \n",
|
198
|
-
"print(predictions_bow_label)"
|
199
|
-
]
|
200
|
-
},
|
201
|
-
{
|
202
|
-
"cell_type": "code",
|
203
|
-
"execution_count": 19,
|
204
|
-
"id": "bcf2ea5a-9100-4263-b9de-cec80f97700b",
|
205
|
-
"metadata": {},
|
206
|
-
"outputs": [
|
207
|
-
{
|
208
|
-
"name": "stdout",
|
209
|
-
"output_type": "stream",
|
210
|
-
"text": [
|
211
|
-
"['positive', 'positive', 'neutral', 'neutral', 'neutral']\n"
|
212
|
-
]
|
213
|
-
}
|
214
|
-
],
|
215
|
-
"source": [
|
216
|
-
"predictions_tfidf_label =['positive' if p >= threshold else 'neutral' for p in data_tfidf_predictions] \n",
|
217
|
-
"print(predictions_tfidf_label)"
|
218
|
-
]
|
219
|
-
},
|
220
|
-
{
|
221
|
-
"cell_type": "code",
|
222
|
-
"execution_count": null,
|
223
|
-
"id": "40d4fc45-068e-46d3-9362-6f2c754f21a3",
|
224
|
-
"metadata": {},
|
225
|
-
"outputs": [],
|
226
|
-
"source": [
|
227
|
-
"\n"
|
228
|
-
]
|
229
|
-
}
|
230
|
-
],
|
231
|
-
"metadata": {
|
232
|
-
"kernelspec": {
|
233
|
-
"display_name": "Python 3 (ipykernel)",
|
234
|
-
"language": "python",
|
235
|
-
"name": "python3"
|
236
|
-
},
|
237
|
-
"language_info": {
|
238
|
-
"codemirror_mode": {
|
239
|
-
"name": "ipython",
|
240
|
-
"version": 3
|
241
|
-
},
|
242
|
-
"file_extension": ".py",
|
243
|
-
"mimetype": "text/x-python",
|
244
|
-
"name": "python",
|
245
|
-
"nbconvert_exporter": "python",
|
246
|
-
"pygments_lexer": "ipython3",
|
247
|
-
"version": "3.12.0"
|
248
|
-
}
|
249
|
-
},
|
250
|
-
"nbformat": 4,
|
251
|
-
"nbformat_minor": 5
|
252
|
-
}
|
Binary file
|