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,204 @@
|
|
1
|
+
{
|
2
|
+
"cells": [
|
3
|
+
{
|
4
|
+
"cell_type": "code",
|
5
|
+
"execution_count": 1,
|
6
|
+
"id": "fbde4a26-a923-4b2a-a20a-5010ae791ff0",
|
7
|
+
"metadata": {},
|
8
|
+
"outputs": [
|
9
|
+
{
|
10
|
+
"name": "stderr",
|
11
|
+
"output_type": "stream",
|
12
|
+
"text": [
|
13
|
+
"[nltk_data] Downloading package stopwords to\n",
|
14
|
+
"[nltk_data] C:\\Users\\sugan\\AppData\\Roaming\\nltk_data...\n",
|
15
|
+
"[nltk_data] Package stopwords is already up-to-date!\n",
|
16
|
+
"[nltk_data] Downloading package punkt to\n",
|
17
|
+
"[nltk_data] C:\\Users\\sugan\\AppData\\Roaming\\nltk_data...\n",
|
18
|
+
"[nltk_data] Package punkt is already up-to-date!\n"
|
19
|
+
]
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"data": {
|
23
|
+
"text/plain": [
|
24
|
+
"True"
|
25
|
+
]
|
26
|
+
},
|
27
|
+
"execution_count": 1,
|
28
|
+
"metadata": {},
|
29
|
+
"output_type": "execute_result"
|
30
|
+
}
|
31
|
+
],
|
32
|
+
"source": [
|
33
|
+
"import nltk\n",
|
34
|
+
"nltk.download('stopwords')\n",
|
35
|
+
"nltk.download('punkt')"
|
36
|
+
]
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"cell_type": "code",
|
40
|
+
"execution_count": 2,
|
41
|
+
"id": "80964614-3a9a-4ec4-8765-08c2ad506753",
|
42
|
+
"metadata": {},
|
43
|
+
"outputs": [
|
44
|
+
{
|
45
|
+
"name": "stdout",
|
46
|
+
"output_type": "stream",
|
47
|
+
"text": [
|
48
|
+
"['#', '#', '#', 'The', 'Impact', 'of', 'Social', 'Media', 'on', 'Modern', 'Communication', 'In', 'the', 'digital', 'age', ',', 'social', 'media', 'has', 'revolutionized', 'the', 'way', 'people', 'communicate', ',', 'offering', 'unprecedented', 'access', 'to', 'information', 'and', 'creating', 'new', 'ways', 'to', 'interact', '.', 'Platforms', 'like', 'Facebook', ',', 'Twitter', ',', 'Instagram', ',', 'and', 'TikTok', 'have', 'connected', 'individuals', 'from', 'across', 'the', 'globe', ',', 'allowing', 'for', 'the', 'instant', 'exchange', 'of', 'ideas', ',', 'images', ',', 'and', 'experiences', '.', 'However', ',', 'the', 'rise', 'of', 'social', 'media', 'has', 'also', 'raised', 'significant', 'concerns', 'about', 'its', 'impact', 'on', 'human', 'relationships', ',', 'mental', 'health', ',', 'and', 'societal', 'dynamics', '.', 'This', 'essay', 'explores', 'the', 'positive', 'and', 'negative', 'effects', 'of', 'social', 'media', 'on', 'modern', 'communication', '.', 'On', 'the', 'positive', 'side', ',', 'social', 'media', 'has', 'made', 'communication', 'more', 'convenient', 'and', 'accessible', 'than', 'ever', 'before', '.', 'In', 'the', 'past', ',', 'staying', 'in', 'touch', 'with', 'friends', 'and', 'family', 'required', 'physical', 'mail', ',', 'phone', 'calls', ',', 'or', 'face-to-face', 'interactions', '.', 'Now', ',', 'platforms', 'like', 'Facebook', 'and', 'WhatsApp', 'allow', 'people', 'to', 'send', 'messages', ',', 'share', 'updates', ',', 'and', 'make', 'video', 'calls', 'at', 'any', 'time', ',', 'from', 'anywhere', 'in', 'the', 'world', '.', 'This', 'has', 'facilitated', 'long-distance', 'relationships', ',', 'strengthened', 'bonds', 'among', 'friends', 'and', 'family', ',', 'and', 'made', 'it', 'easier', 'to', 'stay', 'connected', 'with', 'people', 'who', 'may', 'otherwise', 'be', 'difficult', 'to', 'reach', '.', 'Moreover', ',', 'social', 'media', 'has', 'democratized', 'communication', ',', 'allowing', 'individuals', 'to', 'express', 'their', 'opinions', 'and', 'ideas', 'to', 'a', 'global', 'audience', '.', 'This', 'has', 'had', 'a', 'profound', 'effect', 'on', 'activism', 'and', 'social', 'movements', '.', 'For', 'example', ',', 'platforms', 'like', 'Twitter', 'and', 'Instagram', 'have', 'played', 'crucial', 'roles', 'in', 'raising', 'awareness', 'about', 'issues', 'such', 'as', 'climate', 'change', ',', 'racial', 'injustice', ',', 'and', 'political', 'corruption', '.', 'Activists', 'can', 'mobilize', 'support', ',', 'organize', 'protests', ',', 'and', 'share', 'important', 'information', 'in', 'real', 'time', '.', 'The', 'viral', 'nature', 'of', 'social', 'media', 'also', 'means', 'that', 'messages', 'can', 'reach', 'millions', 'of', 'people', 'in', 'a', 'matter', 'of', 'hours', ',', 'making', 'it', 'an', 'invaluable', 'tool', 'for', 'social', 'change', '.', 'However', ',', 'social', 'media', \"'s\", 'influence', 'is', 'not', 'entirely', 'positive', '.', 'One', 'of', 'the', 'primary', 'concerns', 'is', 'the', 'effect', 'it', 'has', 'on', 'face-to-face', 'communication', 'skills', '.', 'As', 'people', 'spend', 'more', 'time', 'interacting', 'online', ',', 'they', 'may', 'become', 'less', 'adept', 'at', 'having', 'meaningful', 'in-person', 'conversations', '.', 'Social', 'media', 'interactions', 'tend', 'to', 'be', 'more', 'superficial', ',', 'with', 'users', 'often', 'relying', 'on', 'emojis', ',', 'likes', ',', 'or', 'short', 'messages', 'rather', 'than', 'engaging', 'in', 'deep', ',', 'thoughtful', 'discussions', '.', 'This', 'can', 'result', 'in', 'a', 'decline', 'in', 'the', 'quality', 'of', 'personal', 'relationships', ',', 'as', 'online', 'communication', 'often', 'lacks', 'the', 'nuances', 'and', 'emotional', 'depth', 'found', 'in', 'face-to-face', 'conversations', '.', 'Another', 'issue', 'is', 'the', 'impact', 'of', 'social', 'media', 'on', 'mental', 'health', '.', 'Studies', 'have', 'shown', 'that', 'excessive', 'use', 'of', 'platforms', 'like', 'Instagram', 'and', 'Facebook', 'can', 'lead', 'to', 'feelings', 'of', 'isolation', ',', 'anxiety', ',', 'and', 'depression', '.', 'Constant', 'comparison', 'to', 'others', ',', 'especially', 'when', 'viewing', 'curated', ',', 'idealized', 'images', 'of', 'other', 'people', \"'s\", 'lives', ',', 'can', 'lead', 'to', 'low', 'self-esteem', 'and', 'body', 'image', 'issues', '.', 'The', 'pressure', 'to', 'present', 'a', 'perfect', 'life', 'online', ',', 'coupled', 'with', 'the', 'fear', 'of', 'missing', 'out', '(', 'FOMO', ')', ',', 'can', 'also', 'contribute', 'to', 'heightened', 'stress', 'and', 'dissatisfaction', '.', 'Additionally', ',', 'cyberbullying', 'and', 'online', 'harassment', 'have', 'become', 'increasingly', 'prevalent', ',', 'leading', 'to', 'harmful', 'consequences', 'for', 'individuals', ',', 'particularly', 'teenagers', '.', 'Furthermore', ',', 'social', 'media', 'can', 'exacerbate', 'the', 'spread', 'of', 'misinformation', '.', 'Fake', 'news', ',', 'conspiracy', 'theories', ',', 'and', 'misleading', 'content', 'can', 'spread', 'rapidly', 'across', 'platforms', ',', 'influencing', 'public', 'opinion', 'and', 'distorting', 'perceptions', 'of', 'reality', '.', 'The', 'algorithms', 'that', 'govern', 'social', 'media', 'platforms', 'often', 'prioritize', 'content', 'that', 'generates', 'engagement', ',', 'meaning', 'sensational', 'or', 'controversial', 'material', 'is', 'more', 'likely', 'to', 'be', 'shared', 'and', 'seen', 'by', 'a', 'wide', 'audience', '.', 'This', 'can', 'create', 'echo', 'chambers', 'where', 'individuals', 'are', 'exposed', 'only', 'to', 'information', 'that', 'confirms', 'their', 'existing', 'beliefs', ',', 'reinforcing', 'polarization', 'and', 'division', 'in', 'society', '.', 'In', 'conclusion', ',', 'social', 'media', 'has', 'undeniably', 'transformed', 'modern', 'communication', ',', 'making', 'it', 'easier', 'to', 'connect', 'with', 'others', 'and', 'share', 'information', 'on', 'a', 'global', 'scale', '.', 'However', ',', 'its', 'impact', 'on', 'face-to-face', 'interactions', ',', 'mental', 'health', ',', 'and', 'the', 'spread', 'of', 'misinformation', 'presents', 'significant', 'challenges', '.', 'As', 'social', 'media', 'continues', 'to', 'evolve', ',', 'it', 'is', 'crucial', 'that', 'users', 'and', 'society', 'as', 'a', 'whole', 'strike', 'a', 'balance', ',', 'using', 'these', 'platforms', 'in', 'ways', 'that', 'enhance', 'communication', 'while', 'minimizing', 'their', 'negative', 'effects', '.']\n"
|
49
|
+
]
|
50
|
+
}
|
51
|
+
],
|
52
|
+
"source": [
|
53
|
+
"from nltk.corpus import stopwords\n",
|
54
|
+
"from nltk.tokenize import word_tokenize\n",
|
55
|
+
"\n",
|
56
|
+
"f=open(\"sample1.txt\",\"r\")\n",
|
57
|
+
"text=f.read()\n",
|
58
|
+
"\n",
|
59
|
+
"stop_words = set(stopwords.words(\"english\"))\n",
|
60
|
+
"word_tokens = word_tokenize(text)\n",
|
61
|
+
"fil_text = [word for word in word_tokens if word.lower() not in stop_words]\n",
|
62
|
+
"print(word_tokens)"
|
63
|
+
]
|
64
|
+
},
|
65
|
+
{
|
66
|
+
"cell_type": "code",
|
67
|
+
"execution_count": 3,
|
68
|
+
"id": "ba06d703-8acf-47bc-b5cf-164e1af401c5",
|
69
|
+
"metadata": {},
|
70
|
+
"outputs": [
|
71
|
+
{
|
72
|
+
"name": "stdin",
|
73
|
+
"output_type": "stream",
|
74
|
+
"text": [
|
75
|
+
"enter the critical value : 1\n"
|
76
|
+
]
|
77
|
+
},
|
78
|
+
{
|
79
|
+
"name": "stdout",
|
80
|
+
"output_type": "stream",
|
81
|
+
"text": [
|
82
|
+
"0.7496463932107497\n",
|
83
|
+
"[',', 'share', 0.7496463932107497]\n"
|
84
|
+
]
|
85
|
+
}
|
86
|
+
],
|
87
|
+
"source": [
|
88
|
+
"import random\n",
|
89
|
+
"def collocation(w1,w2):\n",
|
90
|
+
" nl=list()\n",
|
91
|
+
" N=len(word_tokens)\n",
|
92
|
+
" prob_w1=word_tokens.count(w1)/N\n",
|
93
|
+
" prob_w2=word_tokens.count(w2)/N\n",
|
94
|
+
" pop_mean=prob_w1*prob_w2\n",
|
95
|
+
" count_w1w2=0\n",
|
96
|
+
" for i in range(len(word_tokens)-1):\n",
|
97
|
+
" if(word_tokens[i]==w1 and word_tokens[i+1]==w2):\n",
|
98
|
+
" count_w1w2=count_w1w2+1\n",
|
99
|
+
" sam_mean=count_w1w2/N\n",
|
100
|
+
" t=(sam_mean-pop_mean)/(sam_mean/N)**0.5\n",
|
101
|
+
" cv=input(\"enter the critical value : \")\n",
|
102
|
+
" if(float(t) > float(cv)):\n",
|
103
|
+
" print(f\"hypothesis rejected thus the given words ('{w1}', '{w2}') form a collocation\")\n",
|
104
|
+
" print(t)\n",
|
105
|
+
" nl.append(w1)\n",
|
106
|
+
" nl.append(w2)\n",
|
107
|
+
" nl.append(t)\n",
|
108
|
+
" print(nl)\n",
|
109
|
+
"fcol=list()\n",
|
110
|
+
"i = random.randint(0,len(word_tokens))\n",
|
111
|
+
"#for i in range(len(word_tokens)-1):\n",
|
112
|
+
"w1=word_tokens[i]\n",
|
113
|
+
"w2=word_tokens[i+1]\n",
|
114
|
+
"fcol.append(collocation(w1,w2))"
|
115
|
+
]
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"cell_type": "code",
|
119
|
+
"execution_count": 4,
|
120
|
+
"id": "2b3fa554-68cb-445d-bd94-86c1a95b9790",
|
121
|
+
"metadata": {},
|
122
|
+
"outputs": [
|
123
|
+
{
|
124
|
+
"name": "stdin",
|
125
|
+
"output_type": "stream",
|
126
|
+
"text": [
|
127
|
+
"enter the critical value : 2\n"
|
128
|
+
]
|
129
|
+
},
|
130
|
+
{
|
131
|
+
"name": "stdout",
|
132
|
+
"output_type": "stream",
|
133
|
+
"text": [
|
134
|
+
"hypothesis accepted thus the given words ('to', 'express') does not form a collocation\n"
|
135
|
+
]
|
136
|
+
}
|
137
|
+
],
|
138
|
+
"source": [
|
139
|
+
"import random\n",
|
140
|
+
"def collocation(w1,w2):\n",
|
141
|
+
" nl=list()\n",
|
142
|
+
" N=len(word_tokens)\n",
|
143
|
+
" count_w1=word_tokens.count(w1)\n",
|
144
|
+
" count_w2=word_tokens.count(w2)\n",
|
145
|
+
"\n",
|
146
|
+
" Exp_w1w2= ((count_w1*count_w2)/N) \n",
|
147
|
+
" Exp_w1nw2= ((count_w1*(N-count_w2))/N)\n",
|
148
|
+
" Exp_nw1w2= (((N-count_w1)*count_w2)/N)\n",
|
149
|
+
" Exp_nw1nw2= (((N-count_w1)*(N-count_w2)/N))\n",
|
150
|
+
"\n",
|
151
|
+
" j=0\n",
|
152
|
+
" count_w1w2=0\n",
|
153
|
+
" for i in range(len(word_tokens)):\n",
|
154
|
+
" if(word_tokens[i]==w1 and word_tokens[i+1]==w2):\n",
|
155
|
+
" count_w1w2=count_w1w2+1\n",
|
156
|
+
" count_w1w2=j\n",
|
157
|
+
" \n",
|
158
|
+
" Obs_w1w2=count_w1w2\n",
|
159
|
+
" Obs_w1nw2=count_w1-count_w1w2\n",
|
160
|
+
" Obs_nw1w2=count_w2-count_w1w2\n",
|
161
|
+
" Obs_nw1nw2=N-count_w1w2\n",
|
162
|
+
"\n",
|
163
|
+
" X= (((Obs_w1w2-Exp_w1w2)**2)/Exp_w1w2) + (((Obs_w1nw2-Exp_w1nw2)**2)/Exp_w1nw2) + (((Obs_nw1w2-Exp_nw1w2)**2)/Exp_nw1w2) + (((Obs_nw1nw2-Exp_nw1nw2)**2)/Exp_nw1nw2)\n",
|
164
|
+
" cv=int(input(\"enter the critical value : \"))\n",
|
165
|
+
" if(float(X) > float(cv)):\n",
|
166
|
+
" print(f\"hypothesis rejected thus the given words ('{w1}', '{w2}') form a collocation\")\n",
|
167
|
+
" print(X)\n",
|
168
|
+
" nl.append(w1)\n",
|
169
|
+
" nl.append(w2)\n",
|
170
|
+
" nl.append(X)\n",
|
171
|
+
" else:print(f\"hypothesis accepted thus the given words ('{w1}', '{w2}') does not form a collocation\")\n",
|
172
|
+
" return nl\n",
|
173
|
+
" \n",
|
174
|
+
"fcol=list()\n",
|
175
|
+
"i = random.randint(0,len(word_tokens))\n",
|
176
|
+
"#for i in range(len(word_tokens)-1):\n",
|
177
|
+
"w1=word_tokens[i]\n",
|
178
|
+
"w2=word_tokens[i+1]\n",
|
179
|
+
"fcol.append(collocation(w1,w2))"
|
180
|
+
]
|
181
|
+
}
|
182
|
+
],
|
183
|
+
"metadata": {
|
184
|
+
"kernelspec": {
|
185
|
+
"display_name": "Python 3 (ipykernel)",
|
186
|
+
"language": "python",
|
187
|
+
"name": "python3"
|
188
|
+
},
|
189
|
+
"language_info": {
|
190
|
+
"codemirror_mode": {
|
191
|
+
"name": "ipython",
|
192
|
+
"version": 3
|
193
|
+
},
|
194
|
+
"file_extension": ".py",
|
195
|
+
"mimetype": "text/x-python",
|
196
|
+
"name": "python",
|
197
|
+
"nbconvert_exporter": "python",
|
198
|
+
"pygments_lexer": "ipython3",
|
199
|
+
"version": "3.12.4"
|
200
|
+
}
|
201
|
+
},
|
202
|
+
"nbformat": 4,
|
203
|
+
"nbformat_minor": 5
|
204
|
+
}
|
@@ -0,0 +1,234 @@
|
|
1
|
+
{
|
2
|
+
"cells": [
|
3
|
+
{
|
4
|
+
"cell_type": "code",
|
5
|
+
"execution_count": 1,
|
6
|
+
"id": "378d2a7f-b3ec-4228-b436-58e4c551adf1",
|
7
|
+
"metadata": {},
|
8
|
+
"outputs": [
|
9
|
+
{
|
10
|
+
"name": "stderr",
|
11
|
+
"output_type": "stream",
|
12
|
+
"text": [
|
13
|
+
"[nltk_data] Downloading package stopwords to\n",
|
14
|
+
"[nltk_data] C:\\Users\\sugan\\AppData\\Roaming\\nltk_data...\n",
|
15
|
+
"[nltk_data] Package stopwords is already up-to-date!\n",
|
16
|
+
"[nltk_data] Downloading package punkt to\n",
|
17
|
+
"[nltk_data] C:\\Users\\sugan\\AppData\\Roaming\\nltk_data...\n",
|
18
|
+
"[nltk_data] Package punkt is already up-to-date!\n"
|
19
|
+
]
|
20
|
+
}
|
21
|
+
],
|
22
|
+
"source": [
|
23
|
+
"import nltk\n",
|
24
|
+
"nltk.download('stopwords')\n",
|
25
|
+
"nltk.download('punkt')\n",
|
26
|
+
"from nltk.corpus import stopwords\n",
|
27
|
+
"from nltk.tokenize import word_tokenize"
|
28
|
+
]
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"cell_type": "code",
|
32
|
+
"execution_count": 2,
|
33
|
+
"id": "e5418f7e-eb6c-4663-af6e-1f05e5e3ee14",
|
34
|
+
"metadata": {},
|
35
|
+
"outputs": [],
|
36
|
+
"source": [
|
37
|
+
"import pandas as pd\n",
|
38
|
+
"import math"
|
39
|
+
]
|
40
|
+
},
|
41
|
+
{
|
42
|
+
"cell_type": "code",
|
43
|
+
"execution_count": 3,
|
44
|
+
"id": "b902b1ab-918a-47d9-b57c-3ab140756a71",
|
45
|
+
"metadata": {},
|
46
|
+
"outputs": [],
|
47
|
+
"source": [
|
48
|
+
"f=open(\"sample2.txt\")\n",
|
49
|
+
"text=f.read()\n",
|
50
|
+
"data=text.splitlines()"
|
51
|
+
]
|
52
|
+
},
|
53
|
+
{
|
54
|
+
"cell_type": "code",
|
55
|
+
"execution_count": 4,
|
56
|
+
"id": "7636c47c-2f57-49ff-ab65-f326ed209def",
|
57
|
+
"metadata": {},
|
58
|
+
"outputs": [],
|
59
|
+
"source": [
|
60
|
+
"ds=list()\n",
|
61
|
+
"for i in data:\n",
|
62
|
+
" tokens=word_tokenize(i)\n",
|
63
|
+
" ds.append(tokens)"
|
64
|
+
]
|
65
|
+
},
|
66
|
+
{
|
67
|
+
"cell_type": "code",
|
68
|
+
"execution_count": 5,
|
69
|
+
"id": "4ed7e570-1bb2-447b-9762-4db619615a23",
|
70
|
+
"metadata": {},
|
71
|
+
"outputs": [
|
72
|
+
{
|
73
|
+
"name": "stdout",
|
74
|
+
"output_type": "stream",
|
75
|
+
"text": [
|
76
|
+
"['chair', 'put', 'coat', ',', 'back', 'Furniture']\n",
|
77
|
+
"['chair', 'IT', 'department', 'Furniture']\n",
|
78
|
+
"['where', 'here', 'put', 'chair', 'Furniture']\n",
|
79
|
+
"['CSE', 'chair', 'head', 'Position']\n"
|
80
|
+
]
|
81
|
+
}
|
82
|
+
],
|
83
|
+
"source": [
|
84
|
+
"for i in ds:\n",
|
85
|
+
" print(i)"
|
86
|
+
]
|
87
|
+
},
|
88
|
+
{
|
89
|
+
"cell_type": "code",
|
90
|
+
"execution_count": 6,
|
91
|
+
"id": "5b5525b9-9c64-4604-ad57-37d6674bfee9",
|
92
|
+
"metadata": {},
|
93
|
+
"outputs": [
|
94
|
+
{
|
95
|
+
"name": "stdin",
|
96
|
+
"output_type": "stream",
|
97
|
+
"text": [
|
98
|
+
"enter sentence: coat black chair\n",
|
99
|
+
"enter word to find sense: chair\n"
|
100
|
+
]
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"name": "stdout",
|
104
|
+
"output_type": "stream",
|
105
|
+
"text": [
|
106
|
+
"-2.0 -3.0\n"
|
107
|
+
]
|
108
|
+
}
|
109
|
+
],
|
110
|
+
"source": [
|
111
|
+
"test_sen = input(\"enter sentence:\")\n",
|
112
|
+
"test_sen = test_sen.split(\" \")\n",
|
113
|
+
"sense_word = input(\"enter word to find sense:\")\n",
|
114
|
+
"\n",
|
115
|
+
" #let us assume that there are two senses(furniture,position)\n",
|
116
|
+
"cf = float(text.count(\"Furniture\"))\n",
|
117
|
+
"cp = float(text.count(\"Position\"))\n",
|
118
|
+
"#12 unique vocabularies\n",
|
119
|
+
"scoref = math.log2((cf+1)/(cf+cp+12))\n",
|
120
|
+
"scorep = math.log2((cp+1)/(cf+cp+12))\n",
|
121
|
+
"print(scoref,scorep)"
|
122
|
+
]
|
123
|
+
},
|
124
|
+
{
|
125
|
+
"cell_type": "code",
|
126
|
+
"execution_count": 7,
|
127
|
+
"id": "11de99e1-3654-4c51-acf3-fd1f9daeaa0b",
|
128
|
+
"metadata": {},
|
129
|
+
"outputs": [],
|
130
|
+
"source": [
|
131
|
+
"fur = list()\n",
|
132
|
+
"pos = list()\n",
|
133
|
+
"for i in ds:\n",
|
134
|
+
" if(\"Furniture\" in i):\n",
|
135
|
+
" fur.append(i)\n",
|
136
|
+
" else:\n",
|
137
|
+
" pos.append(i)"
|
138
|
+
]
|
139
|
+
},
|
140
|
+
{
|
141
|
+
"cell_type": "code",
|
142
|
+
"execution_count": 8,
|
143
|
+
"id": "69385d62-91b3-4df5-a11d-7a60c73401e5",
|
144
|
+
"metadata": {},
|
145
|
+
"outputs": [
|
146
|
+
{
|
147
|
+
"name": "stdout",
|
148
|
+
"output_type": "stream",
|
149
|
+
"text": [
|
150
|
+
"f: 1\n",
|
151
|
+
"pf: 0.13333333333333333\n",
|
152
|
+
"p: 0\n",
|
153
|
+
"pp: 0.07692307692307693\n",
|
154
|
+
"final scoref -4.906890595608519\n",
|
155
|
+
"final scorep -6.700439718141093\n",
|
156
|
+
"f: 0\n",
|
157
|
+
"pf: 0.06666666666666667\n",
|
158
|
+
"p: 0\n",
|
159
|
+
"pp: 0.07692307692307693\n",
|
160
|
+
"final scoref -5.906890595608519\n",
|
161
|
+
"final scorep -6.700439718141093\n",
|
162
|
+
"f: 3\n",
|
163
|
+
"pf: 0.26666666666666666\n",
|
164
|
+
"p: 1\n",
|
165
|
+
"pp: 0.15384615384615385\n",
|
166
|
+
"final scoref -3.9068905956085187\n",
|
167
|
+
"final scorep -5.700439718141093\n"
|
168
|
+
]
|
169
|
+
}
|
170
|
+
],
|
171
|
+
"source": [
|
172
|
+
"for word in test_sen:\n",
|
173
|
+
" p=0\n",
|
174
|
+
" f=0\n",
|
175
|
+
" for i in fur:\n",
|
176
|
+
" if(word in i):\n",
|
177
|
+
" f=f+1\n",
|
178
|
+
" for i in pos:\n",
|
179
|
+
" if(word in i):\n",
|
180
|
+
" p=p+1\n",
|
181
|
+
" print(\"f: \",f)\n",
|
182
|
+
" print(\"pf: \",(f+1)/(cf+12))\n",
|
183
|
+
" print(\"p: \",p)\n",
|
184
|
+
" print(\"pp: \",(p+1)/(cp+12))\n",
|
185
|
+
" final_scoref= scoref + math.log2(((f+1)/(cf+12)))\n",
|
186
|
+
" print(\"final scoref\",final_scoref)\n",
|
187
|
+
" final_scorep= scorep + math.log2(((p+1)/(cp+12)))\n",
|
188
|
+
" print(\"final scorep\",final_scorep)"
|
189
|
+
]
|
190
|
+
},
|
191
|
+
{
|
192
|
+
"cell_type": "code",
|
193
|
+
"execution_count": 9,
|
194
|
+
"id": "49bba1b5-0bfb-4dc8-92a3-0560ae2f01e1",
|
195
|
+
"metadata": {},
|
196
|
+
"outputs": [
|
197
|
+
{
|
198
|
+
"name": "stdout",
|
199
|
+
"output_type": "stream",
|
200
|
+
"text": [
|
201
|
+
"the given chair is of sense Furniture in the given sentence\n"
|
202
|
+
]
|
203
|
+
}
|
204
|
+
],
|
205
|
+
"source": [
|
206
|
+
"if(final_scorep > final_scoref):\n",
|
207
|
+
" print(\"the given \",sense_word,\"is of sense Position in the given sentence\")\n",
|
208
|
+
"else:\n",
|
209
|
+
" print(\"the given \",sense_word,\"is of sense Furniture in the given sentence\")"
|
210
|
+
]
|
211
|
+
}
|
212
|
+
],
|
213
|
+
"metadata": {
|
214
|
+
"kernelspec": {
|
215
|
+
"display_name": "Python 3 (ipykernel)",
|
216
|
+
"language": "python",
|
217
|
+
"name": "python3"
|
218
|
+
},
|
219
|
+
"language_info": {
|
220
|
+
"codemirror_mode": {
|
221
|
+
"name": "ipython",
|
222
|
+
"version": 3
|
223
|
+
},
|
224
|
+
"file_extension": ".py",
|
225
|
+
"mimetype": "text/x-python",
|
226
|
+
"name": "python",
|
227
|
+
"nbconvert_exporter": "python",
|
228
|
+
"pygments_lexer": "ipython3",
|
229
|
+
"version": "3.12.4"
|
230
|
+
}
|
231
|
+
},
|
232
|
+
"nbformat": 4,
|
233
|
+
"nbformat_minor": 5
|
234
|
+
}
|
@@ -0,0 +1,128 @@
|
|
1
|
+
{
|
2
|
+
"cells": [
|
3
|
+
{
|
4
|
+
"cell_type": "code",
|
5
|
+
"execution_count": 1,
|
6
|
+
"id": "fb6ea3e5-356f-49e6-add7-9ea4730f9f0a",
|
7
|
+
"metadata": {},
|
8
|
+
"outputs": [
|
9
|
+
{
|
10
|
+
"name": "stdin",
|
11
|
+
"output_type": "stream",
|
12
|
+
"text": [
|
13
|
+
"Enter the preposition : with\n",
|
14
|
+
"Enter the noun : phone\n",
|
15
|
+
"Enter the Verb : wait\n"
|
16
|
+
]
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"name": "stdout",
|
20
|
+
"output_type": "stream",
|
21
|
+
"text": [
|
22
|
+
"[('saw', 'phone')]\n",
|
23
|
+
"[('went', 'meeting'), ('meeting', 'yesterday')]\n",
|
24
|
+
"[('told', 'man'), ('man', 'wait')]\n",
|
25
|
+
"[('gave', 'book')]\n",
|
26
|
+
"[('saw', 'cat')]\n",
|
27
|
+
"{'saw': 2, 'phone': 1, 'went': 1, 'meeting': 1, 'yesterday': 1, 'told': 1, 'man': 1, 'wait': 1, 'gave': 1, 'book': 1, 'cat': 1}\n",
|
28
|
+
"{'phone': 1, 'yesterday': 2, 'wait': 2, 'book': 1, 'cat': 1}\n",
|
29
|
+
"0\n",
|
30
|
+
"1\n",
|
31
|
+
"0\n",
|
32
|
+
"1\n",
|
33
|
+
"no attachment\n"
|
34
|
+
]
|
35
|
+
}
|
36
|
+
],
|
37
|
+
"source": [
|
38
|
+
"import nltk\n",
|
39
|
+
"import math\n",
|
40
|
+
"from nltk.tokenize import word_tokenize\n",
|
41
|
+
"import string\n",
|
42
|
+
"from nltk.corpus import stopwords\n",
|
43
|
+
"from nltk import bigrams\n",
|
44
|
+
"\n",
|
45
|
+
"prep = input(\"Enter the preposition : \")\n",
|
46
|
+
"noun = input(\"Enter the noun : \")\n",
|
47
|
+
"verb = input(\"Enter the Verb : \")\n",
|
48
|
+
"\n",
|
49
|
+
"stop_words = set(stopwords.words(\"english\"))\n",
|
50
|
+
"\n",
|
51
|
+
"sentences = [\n",
|
52
|
+
" \"Saw the phone with me.\",\n",
|
53
|
+
" \"Went to the meeting yesterday.\",\n",
|
54
|
+
" \"Told the man to wait.\",\n",
|
55
|
+
" \"Gave the book to her.\",\n",
|
56
|
+
" \"Saw the cat with her.\"\n",
|
57
|
+
"]\n",
|
58
|
+
"\n",
|
59
|
+
"unigram = {}\n",
|
60
|
+
"bigram = {}\n",
|
61
|
+
"\n",
|
62
|
+
"for sentence in sentences:\n",
|
63
|
+
" tokens = word_tokenize(sentence)\n",
|
64
|
+
" tokens = [token.lower() for token in tokens if token not in string.punctuation and token not in stop_words]\n",
|
65
|
+
" bigr = list(bigrams(tokens))\n",
|
66
|
+
" print(bigr)\n",
|
67
|
+
" for word in tokens:\n",
|
68
|
+
" if word in unigram:\n",
|
69
|
+
" unigram[word]+=1\n",
|
70
|
+
" else:\n",
|
71
|
+
" unigram[word] = 1\n",
|
72
|
+
" for bi in bigr:\n",
|
73
|
+
" if word in bigram:\n",
|
74
|
+
" bigram[word]+=1\n",
|
75
|
+
" else:\n",
|
76
|
+
" bigram[word] = 1\n",
|
77
|
+
"\n",
|
78
|
+
"print(unigram)\n",
|
79
|
+
"print(bigram)\n",
|
80
|
+
"\n",
|
81
|
+
"bigram.setdefault((noun.lower(),prep.lower()),0)\n",
|
82
|
+
"bigram.setdefault((verb.lower(),prep.lower()),0)\n",
|
83
|
+
"unigram.setdefault(noun.lower(),0)\n",
|
84
|
+
"unigram.setdefault(verb.lower(),0)\n",
|
85
|
+
"unigram.setdefault(prep.lower(),0)\n",
|
86
|
+
"\n",
|
87
|
+
"print(bigram[(noun.lower(),prep.lower())])\n",
|
88
|
+
"print(unigram[noun.lower()])\n",
|
89
|
+
"print(bigram[(verb.lower(),prep.lower())])\n",
|
90
|
+
"print(unigram[verb.lower()])\n",
|
91
|
+
"\n",
|
92
|
+
"pn = bigram[(noun.lower(),prep.lower())]/unigram[noun.lower()]\n",
|
93
|
+
"pv = bigram[(verb.lower(),prep.lower())]/unigram[verb.lower()]\n",
|
94
|
+
"\n",
|
95
|
+
"try: \n",
|
96
|
+
" lam = math.log2((pv*(1-pn))/pn)\n",
|
97
|
+
" if lam < 1:\n",
|
98
|
+
" print(\"attached with noun\")\n",
|
99
|
+
" else:\n",
|
100
|
+
" print(\"attached with verb\")\n",
|
101
|
+
"except ZeroDivisionError as e:\n",
|
102
|
+
" print(\"no attachment\")\n",
|
103
|
+
" "
|
104
|
+
]
|
105
|
+
}
|
106
|
+
],
|
107
|
+
"metadata": {
|
108
|
+
"kernelspec": {
|
109
|
+
"display_name": "Python 3 (ipykernel)",
|
110
|
+
"language": "python",
|
111
|
+
"name": "python3"
|
112
|
+
},
|
113
|
+
"language_info": {
|
114
|
+
"codemirror_mode": {
|
115
|
+
"name": "ipython",
|
116
|
+
"version": 3
|
117
|
+
},
|
118
|
+
"file_extension": ".py",
|
119
|
+
"mimetype": "text/x-python",
|
120
|
+
"name": "python",
|
121
|
+
"nbconvert_exporter": "python",
|
122
|
+
"pygments_lexer": "ipython3",
|
123
|
+
"version": "3.12.4"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
"nbformat": 4,
|
127
|
+
"nbformat_minor": 5
|
128
|
+
}
|