noshot 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- noshot/__init__.py +1 -0
- noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(A) Breadth First Search.ipynb +112 -0
- noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(B) Depth First Search.ipynb +111 -0
- noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(C) Uniform Cost Search.ipynb +134 -0
- noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(D) Depth Limites Search.ipynb +115 -0
- noshot/data/AIDS CN NLP/AIDS/1. Implement Basic Search Strategies/(E) Iterative Deepening DFS.ipynb +123 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/2_ANOVA.csv +769 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/One Way ANOVA (Repeated Measure).ipynb +126 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/One Way ANOVA.ipynb +134 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/Sample 1 Way ANOVA Test.ipynb +119 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/Two Way ANOVA.ipynb +138 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/reaction_time.csv +5 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/sample_data.csv +16 -0
- noshot/data/AIDS CN NLP/AIDS/10. ANOVA/sleep_deprivation.csv +4 -0
- noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/3_Linear.csv +4802 -0
- noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/Linear Regression LAB.ipynb +113 -0
- noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/Linear Regression New- sklearn.ipynb +118 -0
- noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/Linear Regression.ipynb +148 -0
- noshot/data/AIDS CN NLP/AIDS/11. Linear Regression/house_rate.csv +22 -0
- noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/Logistic Regression New- sklearn.ipynb +128 -0
- noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/Logistic Regression.ipynb +145 -0
- noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/default.csv +1001 -0
- noshot/data/AIDS CN NLP/AIDS/12. Logistic Regression/hours_scores_records.csv +101 -0
- noshot/data/AIDS CN NLP/AIDS/2. Implement A Star And MA Star/(A) Astar.ipynb +256 -0
- noshot/data/AIDS CN NLP/AIDS/2. Implement A Star And MA Star/(B) IDAstar.ipynb +157 -0
- noshot/data/AIDS CN NLP/AIDS/2. Implement A Star And MA Star/(C) SMAstar.ipynb +178 -0
- noshot/data/AIDS CN NLP/AIDS/3. Genetic Algorithm/Genetic.ipynb +95 -0
- noshot/data/AIDS CN NLP/AIDS/4. Simulated Annealing/Simulated Annealing.ipynb +74 -0
- noshot/data/AIDS CN NLP/AIDS/4. Simulated Annealing/Sudoku Simulated Annealing.ipynb +103 -0
- noshot/data/AIDS CN NLP/AIDS/5. Alpha Beta Pruning/AlphaBetaPruning.ipynb +182 -0
- noshot/data/AIDS CN NLP/AIDS/6. Consraint Satisfaction Problems (CSP)/(A) CSP House Allocation.ipynb +120 -0
- noshot/data/AIDS CN NLP/AIDS/6. Consraint Satisfaction Problems (CSP)/(B) CSP Map Coloring.ipynb +125 -0
- noshot/data/AIDS CN NLP/AIDS/7. Random Sampling/Random Sampling.ipynb +73 -0
- noshot/data/AIDS CN NLP/AIDS/7. Random Sampling/height_weight_bmi.csv +8389 -0
- noshot/data/AIDS CN NLP/AIDS/8. Z Test/Z Test Hash Function.ipynb +141 -0
- noshot/data/AIDS CN NLP/AIDS/8. Z Test/Z Test.ipynb +151 -0
- noshot/data/AIDS CN NLP/AIDS/8. Z Test/height_weight_bmi.csv +8389 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/1_heart.csv +304 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/Independent T Test.ipynb +119 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/Paired T Test.ipynb +118 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/T Test Hash Function.ipynb +142 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/T Test.ipynb +158 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/height_weight_bmi.csv +8389 -0
- noshot/data/AIDS CN NLP/AIDS/9. T Test/iq_test.csv +0 -0
- noshot/data/AIDS CN NLP/AIDS/Others (AllinOne)/All In One.ipynb +4581 -0
- noshot/data/AIDS CN NLP/CN/1. Chat Application/chat.java +81 -0
- noshot/data/AIDS CN NLP/CN/1. Chat Application/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/1. Chat Application/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/LAN.tcl +65 -0
- noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/analysis.awk +44 -0
- noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/10. Ethernet LAN IEEE 802.3/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/11. Wireless LAN IEEE 802.11/complexdcf.tcl +229 -0
- noshot/data/AIDS CN NLP/CN/11. Wireless LAN IEEE 802.11/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/11. Wireless LAN IEEE 802.11/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/2. File Transfer/file_to_send.txt +2 -0
- noshot/data/AIDS CN NLP/CN/2. File Transfer/filetransfer.java +119 -0
- noshot/data/AIDS CN NLP/CN/2. File Transfer/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/2. File Transfer/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/3. RMI (Remote Method Invocation)/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/3. RMI (Remote Method Invocation)/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/3. RMI (Remote Method Invocation)/rmi.java +56 -0
- noshot/data/AIDS CN NLP/CN/4. Wired Network/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/4. Wired Network/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/4. Wired Network/wired.awk +25 -0
- noshot/data/AIDS CN NLP/CN/4. Wired Network/wired.tcl +81 -0
- noshot/data/AIDS CN NLP/CN/5. Wireless Network/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/5. Wireless Network/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/5. Wireless Network/wireless.awk +27 -0
- noshot/data/AIDS CN NLP/CN/5. Wireless Network/wireless.tcl +153 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/analysis.awk +27 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/sack.tcl +86 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Sack And Vegas/vegas.tcl +86 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/analysis.awk +28 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/reno.tcl +78 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Congestion Control/Tahoe And Reno/tahoe.tcl +79 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Flow Control/analysis.awk +27 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Flow Control/flow.tcl +163 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/TCP Flow Control/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/6. TCP Flow And Congestion Control/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/DV.tcl +111 -0
- noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/LS.tcl +106 -0
- noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/analysis.awk +36 -0
- noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/7. Link State And Distance Vector Routing/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/analysis.awk +20 -0
- noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/broadcast.tcl +76 -0
- noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/multicast.tcl +103 -0
- noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/8. Multicast And Broadcast Routing/procedure.png +0 -0
- noshot/data/AIDS CN NLP/CN/9. DHCP/DHCP.java +125 -0
- noshot/data/AIDS CN NLP/CN/9. DHCP/output.png +0 -0
- noshot/data/AIDS CN NLP/CN/9. DHCP/procedure.png +0 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/1-Prereqs.py +18 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/2-Chi2test.py +83 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/2-T-test.py +79 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/3-WSD-nb.py +53 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/4-Hindle-Rooth.py +53 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/5-HMM-Trellis.py +82 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/6-HMM-Viterbi.py +16 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/7-PCFG-parsetree.py +15 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Chi2test.ipynb +285 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Hindle-Rooth.ipynb +179 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Lab 10 - Text generator using LSTM.ipynb +1461 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Lab 11 NMT.ipynb +2307 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/PCFG.ipynb +134 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Prereqs.ipynb +131 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/T test.ipynb +252 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/TFIDF BOW.ipynb +171 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Trellis.ipynb +244 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/WSD.ipynb +645 -0
- noshot/data/AIDS CN NLP/NLP/NLP 1/Word2Vec.ipynb +93 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab01(tokenizer)/tokenizer.ipynb +370 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab01(tokenizer)/training_tokenizer.txt +6 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/exp0.ipynb +274 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/lab2.ipynb +905 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/test.txt +1 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab02(stemming)/tokenizing.ipynb +272 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab03(parse-tree)/collocation.ipynb +332 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab03(parse-tree)/lab3.ipynb +549 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab03(parse-tree)/nlp.txt +1 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab04(collocation)/Lab4-NLP-Exp-2.ipynb +817 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab04(collocation)/collocation.ipynb +332 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab05(WSD)/NLP-Lab-5-Exp3.ipynb +231 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab05(WSD)/word-sense-disambiguation.ipynb +507 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab06(additional-exercise)/lab6.ipynb +134 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab07(HMM,Viterbi)/NLP Exp 4.ipynb +255 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab07(HMM,Viterbi)/NLP_Exp_5.ipynb +159 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab08(PCFG)/PCFG.ipynb +282 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab09-Hindle-rooth&MLP/Lab 9 - MLP classifier.ipynb +670 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab09-Hindle-rooth&MLP/MLP-alternative-code.ipynb +613 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab09-Hindle-rooth&MLP/hindle-rooth-algorithm.ipynb +74 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab10(LSTM)/Lab_10_Text_generator_using_LSTM.ipynb +480 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/Machine-translation.ipynb +445 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/Viterbi-PCFG.ipynb +105 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/corpora_tools.py +87 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/data_utils.py +11 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab11(Viterbi-PCFG,Machine-translation)/train_translator.py +83 -0
- noshot/data/AIDS CN NLP/NLP/NLP 2/Lab12(Information-Extraction)/Information_Extraction.ipynb +201 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Backtrack-without-Verbitri.ipynb +185 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Backward-Procedure.ipynb +597 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Bag_of.ipynb +1422 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/CYK-algorithm.ipynb +1067 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Forward-Procedure.ipynb +477 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/LSTM.ipynb +1290 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Lab 10 - Text generator using LSTM.ipynb +1461 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/Lab 11 NMT.ipynb +2307 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/NLP-LAB-4.ipynb +216 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/NLP-LAB-5.ipynb +216 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/abc.txt +6 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/ex-1-nltk.ipynb +711 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/ex-2-nlp.ipynb +267 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/exp8&9.ipynb +305 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/hind.ipynb +287 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/lab66.ipynb +752 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/leb_3.ipynb +612 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/naive_bayes_classifier.pkl +0 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/nlp_leb_1.ipynb +3008 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/nlp_leb_2.ipynb +3095 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/nlplab-9.ipynb +295 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/nltk-ex-4.ipynb +506 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/text1.txt +48 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/text2.txt +8 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/text3.txt +48 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/translation-rnn.ipynb +812 -0
- noshot/data/AIDS CN NLP/NLP/NLP 3/word2vector.ipynb +173 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Backward Procedure Algorithm.ipynb +179 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Chi Square Collocation.ipynb +208 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Collocation (T test).ipynb +188 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Experiment 1.ipynb +437 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Forward Procedure Algorithm.ipynb +132 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Hindle Rooth.ipynb +414 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/MachineTranslation.ipynb +368 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Multi Layer Perceptron using MLPClassifier.ipynb +86 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Multi Layer Perceptron using Tensorflow.ipynb +112 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/PCFG Inside Probability.ipynb +451 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Text Generation using LSTM.ipynb +297 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Viterbi.ipynb +310 -0
- noshot/data/AIDS CN NLP/NLP/NLP 4/Word Sense Disambiguation.ipynb +335 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/10.Text Generation using LSTM.ipynb +316 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/11.Machine Translation.ipynb +868 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/2.T and Chi2 Test.ipynb +204 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/3.Word Sense Diambiguation.ipynb +234 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/4.Hinddle and Rooth.ipynb +128 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/5.Forward and Backward.ipynb +149 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/6.Viterbi.ipynb +111 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/7.PCFG Parse Tree.ipynb +134 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/7.PCFG using cyk.ipynb +101 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/8.Bag of words and TF-IDF.ipynb +310 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/9.Word2Vector.ipynb +78 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/NLP ALL In One.ipynb +2619 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/sample1.txt +15 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/sample2.txt +4 -0
- noshot/data/AIDS CN NLP/NLP/NLP 5/word2vec_model.bin +0 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/1. Tokenize, Tagging, NER, Parse Tree.ipynb +312 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/2. T Test and Chi2 Test.ipynb +185 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/3. Naive Bayes WSD.ipynb +199 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/4. Hinddle and Rooth.ipynb +151 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/5 and 6 FWD, BWD, Viterbi.ipynb +164 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/7. PCFG using CYK.ipynb +383 -0
- noshot/data/AIDS CN NLP/NLP/NLP 6/8. BOW and TF-IDF.ipynb +252 -0
- noshot/data/AIDS CN NLP/Ubuntu CN Lab.iso +0 -0
- noshot/main.py +47 -0
- noshot-0.1.0.dist-info/LICENSE.txt +21 -0
- noshot-0.1.0.dist-info/METADATA +65 -0
- noshot-0.1.0.dist-info/RECORD +210 -0
- noshot-0.1.0.dist-info/WHEEL +5 -0
- noshot-0.1.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,173 @@
|
|
1
|
+
{
|
2
|
+
"cells": [
|
3
|
+
{
|
4
|
+
"cell_type": "code",
|
5
|
+
"execution_count": null,
|
6
|
+
"id": "922063be-4bfd-4f18-b051-fff55cb49b29",
|
7
|
+
"metadata": {},
|
8
|
+
"outputs": [],
|
9
|
+
"source": [
|
10
|
+
"#preprocessed_text = \"\""
|
11
|
+
]
|
12
|
+
},
|
13
|
+
{
|
14
|
+
"cell_type": "code",
|
15
|
+
"execution_count": null,
|
16
|
+
"id": "4550cf0a-3517-455e-b386-717e4e030f49",
|
17
|
+
"metadata": {},
|
18
|
+
"outputs": [],
|
19
|
+
"source": [
|
20
|
+
"from sklearn.feature_extraction.text import TfidfVectorizer\n",
|
21
|
+
"tfidf_vectorizer=TfidfVectorizer()\n",
|
22
|
+
"X_tfidf=tfidf_vectorizer.fit_transform([preprocessed_text])\n",
|
23
|
+
"tfidf_vocabulary=tfidf_vectorizer.get_feature_names_out()\n",
|
24
|
+
"tfidf_array=X_tfidf.toarray()\n",
|
25
|
+
"print(\"TF-IDF Vocabulary:\",tfidf_vocabulary)\n",
|
26
|
+
"print(\"\\nTF-IDF Array:\",tfidf_array)"
|
27
|
+
]
|
28
|
+
},
|
29
|
+
{
|
30
|
+
"cell_type": "code",
|
31
|
+
"execution_count": null,
|
32
|
+
"id": "16a77ab0-21d3-424a-9d11-3b7fc5005acc",
|
33
|
+
"metadata": {},
|
34
|
+
"outputs": [],
|
35
|
+
"source": [
|
36
|
+
"import re\n",
|
37
|
+
"import numpy as np\n",
|
38
|
+
"import pandas as pd\n",
|
39
|
+
"import seaborn as sns\n",
|
40
|
+
"import matplotlib.pyplot as plt\n",
|
41
|
+
"from gensim.models import Word2Vec\n",
|
42
|
+
"from nltk.tokenize import word_tokenize\n",
|
43
|
+
"\n",
|
44
|
+
"# Load the dataset\n",
|
45
|
+
"file_path = 'text3.txt'\n",
|
46
|
+
"with open(file_path, 'r', encoding='utf-8') as file:\n",
|
47
|
+
" text = file.read()\n",
|
48
|
+
"\n",
|
49
|
+
"# Preprocessing: convert to lowercase, remove special characters, and tokenize\n",
|
50
|
+
"def preprocess(text):\n",
|
51
|
+
" text = text.lower()\n",
|
52
|
+
" text = re.sub(r'[^a-zA-Z\\s]', '', text) # Remove special characters and numbers\n",
|
53
|
+
" tokens = word_tokenize(text) # Tokenize the text\n",
|
54
|
+
" return tokens\n",
|
55
|
+
"\n",
|
56
|
+
"# Tokenize and preprocess the dataset\n",
|
57
|
+
"tokens = preprocess(text)\n",
|
58
|
+
"\n",
|
59
|
+
"# Train Word2Vec model\n",
|
60
|
+
"model = Word2Vec(sentences=[tokens], vector_size=100, window=5, min_count=1, sg=0) # sg=0 for CBOW\n",
|
61
|
+
"\n",
|
62
|
+
"# Get the list of all unique words in the vocabulary\n",
|
63
|
+
"vocab = list(model.wv.index_to_key)\n",
|
64
|
+
"\n",
|
65
|
+
"# Initialize a matrix to store similarity scores\n",
|
66
|
+
"similarity_matrix = np.zeros((len(vocab), len(vocab)))\n",
|
67
|
+
"\n",
|
68
|
+
"# Compute pairwise similarity for all words in the vocabulary\n",
|
69
|
+
"for i, word1 in enumerate(vocab):\n",
|
70
|
+
" for j, word2 in enumerate(vocab):\n",
|
71
|
+
" similarity_matrix[i, j] = model.wv.similarity(word1, word2)\n",
|
72
|
+
"\n",
|
73
|
+
"# Convert similarity matrix into a pandas DataFrame for easy visualization\n",
|
74
|
+
"similarity_df = pd.DataFrame(similarity_matrix, index=vocab, columns=vocab)\n",
|
75
|
+
"\n",
|
76
|
+
"# Display the first few rows of the similarity matrix\n",
|
77
|
+
"print(similarity_df.head())\n",
|
78
|
+
"\n",
|
79
|
+
"# Plot heatmap of the similarity matrix\n",
|
80
|
+
"plt.figure(figsize=(20, 40))\n",
|
81
|
+
"sns.heatmap(similarity_df, cmap=\"coolwarm\", annot=False, xticklabels=True, yticklabels=True)\n",
|
82
|
+
"plt.title(\"Semantic Similarity Between Words\")\n",
|
83
|
+
"plt.show()\n"
|
84
|
+
]
|
85
|
+
},
|
86
|
+
{
|
87
|
+
"cell_type": "code",
|
88
|
+
"execution_count": null,
|
89
|
+
"id": "a6913d2e-3734-41b4-9285-6ac1afa2b1ee",
|
90
|
+
"metadata": {},
|
91
|
+
"outputs": [],
|
92
|
+
"source": [
|
93
|
+
"import re\n",
|
94
|
+
"import numpy as np\n",
|
95
|
+
"import pandas as pd\n",
|
96
|
+
"import seaborn as sns\n",
|
97
|
+
"import matplotlib.pyplot as plt\n",
|
98
|
+
"from gensim.models import Word2Vec\n",
|
99
|
+
"from nltk.tokenize import word_tokenize\n",
|
100
|
+
"\n",
|
101
|
+
"# Load the dataset\n",
|
102
|
+
"file_path = 'story.txt'\n",
|
103
|
+
"with open(file_path, 'r', encoding='utf-8') as file:\n",
|
104
|
+
" text = file.read()\n",
|
105
|
+
"\n",
|
106
|
+
"# Preprocessing: convert to lowercase, remove special characters, and tokenize\n",
|
107
|
+
"def preprocess(text):\n",
|
108
|
+
" text = text.lower()\n",
|
109
|
+
" text = re.sub(r'[^a-zA-Z\\s]', '', text) # Remove special characters and numbers\n",
|
110
|
+
" tokens = word_tokenize(text) # Tokenize the text\n",
|
111
|
+
" return tokens\n",
|
112
|
+
"\n",
|
113
|
+
"# Tokenize and preprocess the dataset\n",
|
114
|
+
"tokens = preprocess(text)\n",
|
115
|
+
"\n",
|
116
|
+
"# Train Word2Vec model\n",
|
117
|
+
"model = Word2Vec(sentences=[tokens], vector_size=100, window=5, min_count=1, sg=0) # sg=0 for CBOW\n",
|
118
|
+
"\n",
|
119
|
+
"# Get the list of all unique words in the vocabulary\n",
|
120
|
+
"vocab = list(model.wv.index_to_key)\n",
|
121
|
+
"\n",
|
122
|
+
"# Initialize a matrix to store similarity scores\n",
|
123
|
+
"similarity_matrix = np.zeros((len(vocab), len(vocab)))\n",
|
124
|
+
"\n",
|
125
|
+
"# Compute pairwise similarity for all words in the vocabulary\n",
|
126
|
+
"for i, word1 in enumerate(vocab):\n",
|
127
|
+
" for j, word2 in enumerate(vocab):\n",
|
128
|
+
" similarity_matrix[i, j] = model.wv.similarity(word1, word2)\n",
|
129
|
+
"\n",
|
130
|
+
"# Convert similarity matrix into a pandas DataFrame for easy visualization\n",
|
131
|
+
"similarity_df = pd.DataFrame(similarity_matrix, index=vocab, columns=vocab)\n",
|
132
|
+
"\n",
|
133
|
+
"# Display the first few rows of the similarity matrix\n",
|
134
|
+
"print(similarity_df.head())\n",
|
135
|
+
"\n",
|
136
|
+
"# Plot heatmap of the similarity matrix\n",
|
137
|
+
"plt.figure(figsize=(45,40))\n",
|
138
|
+
"sns.heatmap(similarity_df, cmap=\"coolwarm\", annot=False, xticklabels=True, yticklabels=True)\n",
|
139
|
+
"plt.title(\"Semantic Similarity Between Words\")\n",
|
140
|
+
"plt.show()\n"
|
141
|
+
]
|
142
|
+
},
|
143
|
+
{
|
144
|
+
"cell_type": "code",
|
145
|
+
"execution_count": null,
|
146
|
+
"id": "b5676923-468a-4b02-8f57-36633330ccb8",
|
147
|
+
"metadata": {},
|
148
|
+
"outputs": [],
|
149
|
+
"source": []
|
150
|
+
}
|
151
|
+
],
|
152
|
+
"metadata": {
|
153
|
+
"kernelspec": {
|
154
|
+
"display_name": "Python 3 (ipykernel)",
|
155
|
+
"language": "python",
|
156
|
+
"name": "python3"
|
157
|
+
},
|
158
|
+
"language_info": {
|
159
|
+
"codemirror_mode": {
|
160
|
+
"name": "ipython",
|
161
|
+
"version": 3
|
162
|
+
},
|
163
|
+
"file_extension": ".py",
|
164
|
+
"mimetype": "text/x-python",
|
165
|
+
"name": "python",
|
166
|
+
"nbconvert_exporter": "python",
|
167
|
+
"pygments_lexer": "ipython3",
|
168
|
+
"version": "3.12.4"
|
169
|
+
}
|
170
|
+
},
|
171
|
+
"nbformat": 4,
|
172
|
+
"nbformat_minor": 5
|
173
|
+
}
|
@@ -0,0 +1,179 @@
|
|
1
|
+
{
|
2
|
+
"nbformat": 4,
|
3
|
+
"nbformat_minor": 0,
|
4
|
+
"metadata": {
|
5
|
+
"colab": {
|
6
|
+
"provenance": []
|
7
|
+
},
|
8
|
+
"kernelspec": {
|
9
|
+
"name": "python3",
|
10
|
+
"display_name": "Python 3"
|
11
|
+
},
|
12
|
+
"language_info": {
|
13
|
+
"name": "python"
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"cells": [
|
17
|
+
{
|
18
|
+
"cell_type": "code",
|
19
|
+
"execution_count": null,
|
20
|
+
"metadata": {
|
21
|
+
"colab": {
|
22
|
+
"base_uri": "https://localhost:8080/"
|
23
|
+
},
|
24
|
+
"id": "gVbwDSwfR3CY",
|
25
|
+
"outputId": "84d47a98-d4d4-4b51-a679-65654164125c"
|
26
|
+
},
|
27
|
+
"outputs": [
|
28
|
+
{
|
29
|
+
"output_type": "stream",
|
30
|
+
"name": "stderr",
|
31
|
+
"text": [
|
32
|
+
"[nltk_data] Downloading package stopwords to /root/nltk_data...\n",
|
33
|
+
"[nltk_data] Package stopwords is already up-to-date!\n",
|
34
|
+
"[nltk_data] Downloading package punkt to /root/nltk_data...\n",
|
35
|
+
"[nltk_data] Package punkt is already up-to-date!\n",
|
36
|
+
"[nltk_data] Downloading package averaged_perceptron_tagger to\n",
|
37
|
+
"[nltk_data] /root/nltk_data...\n",
|
38
|
+
"[nltk_data] Package averaged_perceptron_tagger is already up-to-\n",
|
39
|
+
"[nltk_data] date!\n"
|
40
|
+
]
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"output_type": "execute_result",
|
44
|
+
"data": {
|
45
|
+
"text/plain": [
|
46
|
+
"True"
|
47
|
+
]
|
48
|
+
},
|
49
|
+
"metadata": {},
|
50
|
+
"execution_count": 43
|
51
|
+
}
|
52
|
+
],
|
53
|
+
"source": [
|
54
|
+
"import nltk\n",
|
55
|
+
"nltk.download('stopwords')\n",
|
56
|
+
"nltk.download('punkt')\n",
|
57
|
+
"from nltk.corpus import stopwords\n",
|
58
|
+
"from nltk import pos_tag,word_tokenize\n",
|
59
|
+
"import pandas as pd\n",
|
60
|
+
"import math\n",
|
61
|
+
"nltk.download('averaged_perceptron_tagger')"
|
62
|
+
]
|
63
|
+
},
|
64
|
+
{
|
65
|
+
"cell_type": "code",
|
66
|
+
"source": [
|
67
|
+
"def bpa(pi,state,transition,words):\n",
|
68
|
+
" words=list(reversed(words))\n",
|
69
|
+
" for i in range(len(state)):\n",
|
70
|
+
" beta.update({i:{len(words)+1:1}})\n",
|
71
|
+
" #ok=-1\n",
|
72
|
+
"\n",
|
73
|
+
" for t in reversed(range(1,len(words)+1)):\n",
|
74
|
+
" #temp=list()\n",
|
75
|
+
" #ok=ok+1\n",
|
76
|
+
" for i in range(0,len(state)):\n",
|
77
|
+
" val=0\n",
|
78
|
+
" for j in range(0,len(state)):\n",
|
79
|
+
" ok=words[(len(words)+1)-(t+1)]\n",
|
80
|
+
" val=val+(state[i][j]*transition[i][ok]*beta[j][t+1])\n",
|
81
|
+
" print(\"k : \",ok,\"i: \",i,\"j: \",j,\"beta({},{}): \".format(j,t+1),beta[j][t+1],\"ok value: \",ok)\n",
|
82
|
+
" print(\"\\t\",state[i][j],\"*\",transition[i][ok],\"*\",beta[i][t+1])\n",
|
83
|
+
" #temp.append(val)\n",
|
84
|
+
" beta[i][t]=val\n",
|
85
|
+
" print(\"\\t beta({}{}): \".format(i,t),val)\n",
|
86
|
+
" val=0\n",
|
87
|
+
" #print(\"updated val: \",val,\"updated temp: \",temp,\"\\n\")\n",
|
88
|
+
" fsum=0\n",
|
89
|
+
" for i in range(len(state)):\n",
|
90
|
+
" fsum=fsum+beta[i][1]\n",
|
91
|
+
" return fsum"
|
92
|
+
],
|
93
|
+
"metadata": {
|
94
|
+
"id": "xIZ1yukLSCL4"
|
95
|
+
},
|
96
|
+
"execution_count": null,
|
97
|
+
"outputs": []
|
98
|
+
},
|
99
|
+
{
|
100
|
+
"cell_type": "code",
|
101
|
+
"source": [
|
102
|
+
"state=[[0.7,0.3],[0.5,0.5]]\n",
|
103
|
+
"transition=[[0.6,0.1,0.3],[0.1,0.7,0.2]]\n",
|
104
|
+
"words=[2,1,0]\n",
|
105
|
+
"\n",
|
106
|
+
"ans=bpa(pi,state,transition,words)\n"
|
107
|
+
],
|
108
|
+
"metadata": {
|
109
|
+
"id": "rr4yPQHDSYYA",
|
110
|
+
"colab": {
|
111
|
+
"base_uri": "https://localhost:8080/"
|
112
|
+
},
|
113
|
+
"outputId": "c0fbbcc3-c7ff-4906-f082-f0152207832f"
|
114
|
+
},
|
115
|
+
"execution_count": null,
|
116
|
+
"outputs": [
|
117
|
+
{
|
118
|
+
"output_type": "stream",
|
119
|
+
"name": "stdout",
|
120
|
+
"text": [
|
121
|
+
"k : 0 i: 0 j: 0 beta(0,4): 1 ok value: 0\n",
|
122
|
+
"\t 0.7 * 0.6 * 1\n",
|
123
|
+
"k : 0 i: 0 j: 1 beta(1,4): 1 ok value: 0\n",
|
124
|
+
"\t 0.3 * 0.6 * 1\n",
|
125
|
+
"\t beta(03): 0.6\n",
|
126
|
+
"k : 0 i: 1 j: 0 beta(0,4): 1 ok value: 0\n",
|
127
|
+
"\t 0.5 * 0.1 * 1\n",
|
128
|
+
"k : 0 i: 1 j: 1 beta(1,4): 1 ok value: 0\n",
|
129
|
+
"\t 0.5 * 0.1 * 1\n",
|
130
|
+
"\t beta(13): 0.1\n",
|
131
|
+
"k : 1 i: 0 j: 0 beta(0,3): 0.6 ok value: 1\n",
|
132
|
+
"\t 0.7 * 0.1 * 0.6\n",
|
133
|
+
"k : 1 i: 0 j: 1 beta(1,3): 0.1 ok value: 1\n",
|
134
|
+
"\t 0.3 * 0.1 * 0.6\n",
|
135
|
+
"\t beta(02): 0.045\n",
|
136
|
+
"k : 1 i: 1 j: 0 beta(0,3): 0.6 ok value: 1\n",
|
137
|
+
"\t 0.5 * 0.7 * 0.1\n",
|
138
|
+
"k : 1 i: 1 j: 1 beta(1,3): 0.1 ok value: 1\n",
|
139
|
+
"\t 0.5 * 0.7 * 0.1\n",
|
140
|
+
"\t beta(12): 0.245\n",
|
141
|
+
"k : 2 i: 0 j: 0 beta(0,2): 0.045 ok value: 2\n",
|
142
|
+
"\t 0.7 * 0.3 * 0.045\n",
|
143
|
+
"k : 2 i: 0 j: 1 beta(1,2): 0.245 ok value: 2\n",
|
144
|
+
"\t 0.3 * 0.3 * 0.045\n",
|
145
|
+
"\t beta(01): 0.0315\n",
|
146
|
+
"k : 2 i: 1 j: 0 beta(0,2): 0.045 ok value: 2\n",
|
147
|
+
"\t 0.5 * 0.2 * 0.245\n",
|
148
|
+
"k : 2 i: 1 j: 1 beta(1,2): 0.245 ok value: 2\n",
|
149
|
+
"\t 0.5 * 0.2 * 0.245\n",
|
150
|
+
"\t beta(11): 0.029\n"
|
151
|
+
]
|
152
|
+
}
|
153
|
+
]
|
154
|
+
},
|
155
|
+
{
|
156
|
+
"cell_type": "code",
|
157
|
+
"source": [
|
158
|
+
"print(\"final probability for given words: \",ans)"
|
159
|
+
],
|
160
|
+
"metadata": {
|
161
|
+
"colab": {
|
162
|
+
"base_uri": "https://localhost:8080/"
|
163
|
+
},
|
164
|
+
"id": "9rmYcYrY3yHl",
|
165
|
+
"outputId": "9a6c3008-27ca-4a21-e20b-ae5397827149"
|
166
|
+
},
|
167
|
+
"execution_count": null,
|
168
|
+
"outputs": [
|
169
|
+
{
|
170
|
+
"output_type": "stream",
|
171
|
+
"name": "stdout",
|
172
|
+
"text": [
|
173
|
+
"final probability for given words: 0.0605\n"
|
174
|
+
]
|
175
|
+
}
|
176
|
+
]
|
177
|
+
}
|
178
|
+
]
|
179
|
+
}
|
@@ -0,0 +1,208 @@
|
|
1
|
+
{
|
2
|
+
"nbformat": 4,
|
3
|
+
"nbformat_minor": 0,
|
4
|
+
"metadata": {
|
5
|
+
"colab": {
|
6
|
+
"provenance": []
|
7
|
+
},
|
8
|
+
"kernelspec": {
|
9
|
+
"name": "python3",
|
10
|
+
"display_name": "Python 3"
|
11
|
+
},
|
12
|
+
"language_info": {
|
13
|
+
"name": "python"
|
14
|
+
}
|
15
|
+
},
|
16
|
+
"cells": [
|
17
|
+
{
|
18
|
+
"cell_type": "code",
|
19
|
+
"source": [
|
20
|
+
"import nltk\n",
|
21
|
+
"nltk.download('stopwords')\n",
|
22
|
+
"nltk.download('punkt')"
|
23
|
+
],
|
24
|
+
"metadata": {
|
25
|
+
"colab": {
|
26
|
+
"base_uri": "https://localhost:8080/"
|
27
|
+
},
|
28
|
+
"id": "DLR4rnnIgiqo",
|
29
|
+
"outputId": "a27f8918-2355-4417-ef8c-908e8aa648a5"
|
30
|
+
},
|
31
|
+
"execution_count": null,
|
32
|
+
"outputs": [
|
33
|
+
{
|
34
|
+
"output_type": "stream",
|
35
|
+
"name": "stderr",
|
36
|
+
"text": [
|
37
|
+
"[nltk_data] Downloading package stopwords to /root/nltk_data...\n",
|
38
|
+
"[nltk_data] Package stopwords is already up-to-date!\n",
|
39
|
+
"[nltk_data] Downloading package punkt to /root/nltk_data...\n",
|
40
|
+
"[nltk_data] Package punkt is already up-to-date!\n"
|
41
|
+
]
|
42
|
+
},
|
43
|
+
{
|
44
|
+
"output_type": "execute_result",
|
45
|
+
"data": {
|
46
|
+
"text/plain": [
|
47
|
+
"True"
|
48
|
+
]
|
49
|
+
},
|
50
|
+
"metadata": {},
|
51
|
+
"execution_count": 2
|
52
|
+
}
|
53
|
+
]
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"cell_type": "code",
|
57
|
+
"source": [
|
58
|
+
"from nltk.tokenize import word_tokenize\n",
|
59
|
+
"\n",
|
60
|
+
"f=open(\"/content/sample.txt\",\"r\")\n",
|
61
|
+
"text=f.read()\n",
|
62
|
+
"text=text.lower()\n",
|
63
|
+
"word_tokens = word_tokenize(text)\n",
|
64
|
+
"print(word_tokens)\n"
|
65
|
+
],
|
66
|
+
"metadata": {
|
67
|
+
"colab": {
|
68
|
+
"base_uri": "https://localhost:8080/"
|
69
|
+
},
|
70
|
+
"id": "t8RO6ZQEgeXB",
|
71
|
+
"outputId": "01e1b0db-e84f-4f39-8735-393f526f47a3"
|
72
|
+
},
|
73
|
+
"execution_count": null,
|
74
|
+
"outputs": [
|
75
|
+
{
|
76
|
+
"output_type": "stream",
|
77
|
+
"name": "stdout",
|
78
|
+
"text": [
|
79
|
+
"['sastra', 'university', 'is', 'good', 'sastra', 'university', 'is', 'in', 'thanjavur', 'trichy', 'is', 'relatively', 'close', 'from', 'sastra', 'university', 'various', 'other', 'university', 'are', 'also', 'present', 'in', 'tamilnadu', 'sastra', 'offers', 'a', 'lot', 'of', 'courses', 'sastra', 'is', 'an', 'acronym', 'nit', 'is', 'also', 'a', 'college', 'near', 'trichy', ',', 'but', 'not', 'a', 'university']\n"
|
80
|
+
]
|
81
|
+
}
|
82
|
+
]
|
83
|
+
},
|
84
|
+
{
|
85
|
+
"cell_type": "code",
|
86
|
+
"execution_count": null,
|
87
|
+
"metadata": {
|
88
|
+
"id": "Qt6BAzwcf5PK"
|
89
|
+
},
|
90
|
+
"outputs": [],
|
91
|
+
"source": [
|
92
|
+
"def collocation(w1,w2):\n",
|
93
|
+
" nl=list()\n",
|
94
|
+
" N=len(word_tokens)\n",
|
95
|
+
" pw1=word_tokens.count(w1)\n",
|
96
|
+
" pw2=word_tokens.count(w2)\n",
|
97
|
+
"\n",
|
98
|
+
" Ew1w2= ((pw1*pw2)/N) \n",
|
99
|
+
" Ew1nw2= ((pw1*(N-pw2))/N)\n",
|
100
|
+
" Enw1w2= (((N-pw1)*pw2)/N)\n",
|
101
|
+
" Enw1nw2= (((N-pw1)*(N-pw2)/N))\n",
|
102
|
+
"\n",
|
103
|
+
" j=0\n",
|
104
|
+
" for i in range(len(word_tokens)-1):\n",
|
105
|
+
" if(word_tokens[i]==w1 and word_tokens[i+1]==w2):\n",
|
106
|
+
" j=j+1\n",
|
107
|
+
" pw12=j\n",
|
108
|
+
" \n",
|
109
|
+
" Ow1w2=pw12\n",
|
110
|
+
" Ow1nw2=pw1-pw12\n",
|
111
|
+
" Onw1w2=pw2-pw12\n",
|
112
|
+
" Onw1nw2=N-pw12\n",
|
113
|
+
"\n",
|
114
|
+
" X= (((Ow1w2-Ew1w2)**2)/Ew1w2) + (((Ow1nw2-Ew1nw2)**2)/Ew1nw2) + (((Onw1w2-Enw1w2)**2)/Enw1w2) + (((Onw1nw2-Enw1nw2)**2)/Enw1nw2)\n",
|
115
|
+
" \n",
|
116
|
+
" if(float(X) > float(cv)):\n",
|
117
|
+
" #print(\"hypothesis rejected thus the given words( \",w1,\" \",w2,\" ) form a collocation\")\n",
|
118
|
+
" #print(X)\n",
|
119
|
+
" nl.append(w1)\n",
|
120
|
+
" nl.append(w2)\n",
|
121
|
+
" nl.append(X)\n",
|
122
|
+
" return nl"
|
123
|
+
]
|
124
|
+
},
|
125
|
+
{
|
126
|
+
"cell_type": "code",
|
127
|
+
"source": [
|
128
|
+
"cv=int(input(\"enter the critical value : \"))"
|
129
|
+
],
|
130
|
+
"metadata": {
|
131
|
+
"colab": {
|
132
|
+
"base_uri": "https://localhost:8080/"
|
133
|
+
},
|
134
|
+
"id": "C-B4kq2of7pS",
|
135
|
+
"outputId": "d61ad4c3-7224-4325-8079-de7c337c8e37"
|
136
|
+
},
|
137
|
+
"execution_count": null,
|
138
|
+
"outputs": [
|
139
|
+
{
|
140
|
+
"name": "stdout",
|
141
|
+
"output_type": "stream",
|
142
|
+
"text": [
|
143
|
+
"enter the critical value : 10\n"
|
144
|
+
]
|
145
|
+
}
|
146
|
+
]
|
147
|
+
},
|
148
|
+
{
|
149
|
+
"cell_type": "code",
|
150
|
+
"source": [
|
151
|
+
"fcol=list()\n",
|
152
|
+
"for i in range(len(word_tokens)-1):\n",
|
153
|
+
" w1=word_tokens[i]\n",
|
154
|
+
" w2=word_tokens[i+1]\n",
|
155
|
+
" fcol.append(collocation(w1,w2))\n",
|
156
|
+
"for i in fcol:\n",
|
157
|
+
" if(len(i) > 1):\n",
|
158
|
+
" if(fcol.count(i)>1):\n",
|
159
|
+
" fcol.remove(i)\n",
|
160
|
+
" else:\n",
|
161
|
+
" fcol.remove(i)\n",
|
162
|
+
" \n",
|
163
|
+
"for i in fcol:\n",
|
164
|
+
" if(len(i) > 1):\n",
|
165
|
+
" print(i)"
|
166
|
+
],
|
167
|
+
"metadata": {
|
168
|
+
"colab": {
|
169
|
+
"base_uri": "https://localhost:8080/"
|
170
|
+
},
|
171
|
+
"id": "lBTZtPcaf-rZ",
|
172
|
+
"outputId": "38a7d8d6-d49c-43b9-9cdd-c0d9b506d0d9"
|
173
|
+
},
|
174
|
+
"execution_count": null,
|
175
|
+
"outputs": [
|
176
|
+
{
|
177
|
+
"output_type": "stream",
|
178
|
+
"name": "stdout",
|
179
|
+
"text": [
|
180
|
+
"['in', 'thanjavur', 22.556565656565656]\n",
|
181
|
+
"['thanjavur', 'trichy', 22.556565656565656]\n",
|
182
|
+
"['relatively', 'close', 46.0]\n",
|
183
|
+
"['close', 'from', 46.0]\n",
|
184
|
+
"['sastra', 'university', 14.952385484830458]\n",
|
185
|
+
"['various', 'other', 46.0]\n",
|
186
|
+
"['are', 'also', 22.556565656565656]\n",
|
187
|
+
"['also', 'present', 22.556565656565656]\n",
|
188
|
+
"['present', 'in', 22.556565656565656]\n",
|
189
|
+
"['in', 'tamilnadu', 22.556565656565656]\n",
|
190
|
+
"['offers', 'a', 14.835831180017228]\n",
|
191
|
+
"['a', 'lot', 14.835831180017228]\n",
|
192
|
+
"['lot', 'of', 46.0]\n",
|
193
|
+
"['of', 'courses', 46.0]\n",
|
194
|
+
"['an', 'acronym', 46.0]\n",
|
195
|
+
"['acronym', 'nit', 46.0]\n",
|
196
|
+
"['a', 'college', 14.835831180017228]\n",
|
197
|
+
"['college', 'near', 46.0]\n",
|
198
|
+
"['near', 'trichy', 22.556565656565656]\n",
|
199
|
+
"['trichy', ',', 22.556565656565656]\n",
|
200
|
+
"[',', 'but', 46.0]\n",
|
201
|
+
"['but', 'not', 46.0]\n",
|
202
|
+
"['not', 'a', 14.835831180017228]\n"
|
203
|
+
]
|
204
|
+
}
|
205
|
+
]
|
206
|
+
}
|
207
|
+
]
|
208
|
+
}
|