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,188 @@
|
|
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": "DF_ZwwBZYlOy",
|
25
|
+
"outputId": "b520aae1-aca8-419e-d136-bf777f5b9d7f"
|
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
|
+
]
|
37
|
+
},
|
38
|
+
{
|
39
|
+
"output_type": "execute_result",
|
40
|
+
"data": {
|
41
|
+
"text/plain": [
|
42
|
+
"True"
|
43
|
+
]
|
44
|
+
},
|
45
|
+
"metadata": {},
|
46
|
+
"execution_count": 2
|
47
|
+
}
|
48
|
+
],
|
49
|
+
"source": [
|
50
|
+
"import nltk\n",
|
51
|
+
"nltk.download('stopwords')\n",
|
52
|
+
"nltk.download('punkt')"
|
53
|
+
]
|
54
|
+
},
|
55
|
+
{
|
56
|
+
"cell_type": "code",
|
57
|
+
"source": [
|
58
|
+
"from nltk.corpus import stopwords\n",
|
59
|
+
"from nltk.tokenize import word_tokenize\n",
|
60
|
+
"\n",
|
61
|
+
"f=open(\"/content/sample.txt\",\"r\")\n",
|
62
|
+
"text=f.read()\n",
|
63
|
+
"\n",
|
64
|
+
"stop_words = set(stopwords.words(\"english\"))\n",
|
65
|
+
"word_tokens = word_tokenize(text)\n",
|
66
|
+
"fil_text = [word for word in word_tokens if word not in stop_words]\n",
|
67
|
+
"print(word_tokens)\n"
|
68
|
+
],
|
69
|
+
"metadata": {
|
70
|
+
"colab": {
|
71
|
+
"base_uri": "https://localhost:8080/"
|
72
|
+
},
|
73
|
+
"id": "p1EFKoWCYmtH",
|
74
|
+
"outputId": "4a56d953-65bf-4924-8bdb-91a976a3af47"
|
75
|
+
},
|
76
|
+
"execution_count": null,
|
77
|
+
"outputs": [
|
78
|
+
{
|
79
|
+
"output_type": "stream",
|
80
|
+
"name": "stdout",
|
81
|
+
"text": [
|
82
|
+
"['hi', 'this', 'is', 'a', 'sample', 'text', 'for', 'natural', 'language', 'processing', 'natural', 'language', 'processing', 'has', 'various', 'advantages', '.']\n"
|
83
|
+
]
|
84
|
+
}
|
85
|
+
]
|
86
|
+
},
|
87
|
+
{
|
88
|
+
"cell_type": "code",
|
89
|
+
"source": [
|
90
|
+
"def collocation(w1,w2):\n",
|
91
|
+
" nl=list()\n",
|
92
|
+
" N=len(word_tokens)\n",
|
93
|
+
" pw1=word_tokens.count(w1)\n",
|
94
|
+
" pw2=word_tokens.count(w2)\n",
|
95
|
+
" md=((pw1/N)*(pw2/N))\n",
|
96
|
+
" j=0\n",
|
97
|
+
" for i in range(len(word_tokens)):\n",
|
98
|
+
" if(word_tokens[i]==w1 and word_tokens[i+1]==w2):\n",
|
99
|
+
" j=j+1\n",
|
100
|
+
" pw12=j\n",
|
101
|
+
" x=pw12/N\n",
|
102
|
+
" s2=x\n",
|
103
|
+
" t=(x-md)/(x/N)**0.5\n",
|
104
|
+
" if(float(t) > float(cv)):\n",
|
105
|
+
" print(\"hypothesis rejected thus the given words( \",w1,\" \",w2,\" ) form a collocation\")\n",
|
106
|
+
" print(t)\n",
|
107
|
+
" nl.append(w1)\n",
|
108
|
+
" nl.append(w2)\n",
|
109
|
+
" nl.append(t)\n",
|
110
|
+
" return nl"
|
111
|
+
],
|
112
|
+
"metadata": {
|
113
|
+
"id": "F_3yVJF-Ys19"
|
114
|
+
},
|
115
|
+
"execution_count": null,
|
116
|
+
"outputs": []
|
117
|
+
},
|
118
|
+
{
|
119
|
+
"cell_type": "code",
|
120
|
+
"source": [
|
121
|
+
"cv=input(\"enter the critical value : \")"
|
122
|
+
],
|
123
|
+
"metadata": {
|
124
|
+
"colab": {
|
125
|
+
"base_uri": "https://localhost:8080/"
|
126
|
+
},
|
127
|
+
"id": "A2sGU4O2alhl",
|
128
|
+
"outputId": "dd8df949-19d2-441e-f421-1bca5f1fe98e"
|
129
|
+
},
|
130
|
+
"execution_count": null,
|
131
|
+
"outputs": [
|
132
|
+
{
|
133
|
+
"name": "stdout",
|
134
|
+
"output_type": "stream",
|
135
|
+
"text": [
|
136
|
+
"enter the critical value : 1\n"
|
137
|
+
]
|
138
|
+
}
|
139
|
+
]
|
140
|
+
},
|
141
|
+
{
|
142
|
+
"cell_type": "code",
|
143
|
+
"source": [
|
144
|
+
"fcol=list()\n",
|
145
|
+
"for i in range(len(word_tokens)-1):\n",
|
146
|
+
" w1=word_tokens[i]\n",
|
147
|
+
" w2=word_tokens[i+1]\n",
|
148
|
+
" fcol.append(collocation(w1,w2))\n",
|
149
|
+
"for i in fcol:\n",
|
150
|
+
" if(len(i) > 1):\n",
|
151
|
+
" if(fcol.count(i)>1):\n",
|
152
|
+
" fcol.remove(i)\n",
|
153
|
+
" else:\n",
|
154
|
+
" fcol.remove(i)\n",
|
155
|
+
" \n",
|
156
|
+
"for i in fcol:\n",
|
157
|
+
" if(len(i) > 1):\n",
|
158
|
+
" print(i)"
|
159
|
+
],
|
160
|
+
"metadata": {
|
161
|
+
"colab": {
|
162
|
+
"base_uri": "https://localhost:8080/"
|
163
|
+
},
|
164
|
+
"id": "rdNNhGmUYzC2",
|
165
|
+
"outputId": "dc8b4b05-c546-4600-ae7c-c62bc3ed5ed5"
|
166
|
+
},
|
167
|
+
"execution_count": null,
|
168
|
+
"outputs": [
|
169
|
+
{
|
170
|
+
"output_type": "stream",
|
171
|
+
"name": "stdout",
|
172
|
+
"text": [
|
173
|
+
"hypothesis rejected thus the given words( natural language ) form a collocation\n",
|
174
|
+
"1.2478354962115543\n",
|
175
|
+
"hypothesis rejected thus the given words( language processing ) form a collocation\n",
|
176
|
+
"1.2478354962115543\n",
|
177
|
+
"hypothesis rejected thus the given words( natural language ) form a collocation\n",
|
178
|
+
"1.2478354962115543\n",
|
179
|
+
"hypothesis rejected thus the given words( language processing ) form a collocation\n",
|
180
|
+
"1.2478354962115543\n",
|
181
|
+
"['natural', 'language', 1.2478354962115543]\n",
|
182
|
+
"['language', 'processing', 1.2478354962115543]\n"
|
183
|
+
]
|
184
|
+
}
|
185
|
+
]
|
186
|
+
}
|
187
|
+
]
|
188
|
+
}
|
@@ -0,0 +1,437 @@
|
|
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": "pp2qf3zYXaiT",
|
25
|
+
"outputId": "873c7148-85ea-4ff2-eca1-5fc88f5af441"
|
26
|
+
},
|
27
|
+
"outputs": [
|
28
|
+
{
|
29
|
+
"output_type": "stream",
|
30
|
+
"name": "stdout",
|
31
|
+
"text": [
|
32
|
+
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
|
33
|
+
"Requirement already satisfied: spacy in /usr/local/lib/python3.8/dist-packages (3.4.4)\n",
|
34
|
+
"Requirement already satisfied: pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4 in /usr/local/lib/python3.8/dist-packages (from spacy) (1.10.4)\n",
|
35
|
+
"Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from spacy) (2.0.7)\n",
|
36
|
+
"Requirement already satisfied: setuptools in /usr/local/lib/python3.8/dist-packages (from spacy) (57.4.0)\n",
|
37
|
+
"Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (4.64.1)\n",
|
38
|
+
"Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (1.0.9)\n",
|
39
|
+
"Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.10 in /usr/local/lib/python3.8/dist-packages (from spacy) (3.0.11)\n",
|
40
|
+
"Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.8/dist-packages (from spacy) (2.0.8)\n",
|
41
|
+
"Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (21.3)\n",
|
42
|
+
"Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.8/dist-packages (from spacy) (3.0.8)\n",
|
43
|
+
"Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (2.25.1)\n",
|
44
|
+
"Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /usr/local/lib/python3.8/dist-packages (from spacy) (2.4.5)\n",
|
45
|
+
"Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (1.0.4)\n",
|
46
|
+
"Requirement already satisfied: typer<0.8.0,>=0.3.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (0.7.0)\n",
|
47
|
+
"Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (3.3.0)\n",
|
48
|
+
"Requirement already satisfied: numpy>=1.15.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (1.21.6)\n",
|
49
|
+
"Requirement already satisfied: pathy>=0.3.5 in /usr/local/lib/python3.8/dist-packages (from spacy) (0.10.1)\n",
|
50
|
+
"Requirement already satisfied: wasabi<1.1.0,>=0.9.1 in /usr/local/lib/python3.8/dist-packages (from spacy) (0.10.1)\n",
|
51
|
+
"Requirement already satisfied: thinc<8.2.0,>=8.1.0 in /usr/local/lib/python3.8/dist-packages (from spacy) (8.1.6)\n",
|
52
|
+
"Requirement already satisfied: jinja2 in /usr/local/lib/python3.8/dist-packages (from spacy) (2.11.3)\n",
|
53
|
+
"Requirement already satisfied: smart-open<7.0.0,>=5.2.1 in /usr/local/lib/python3.8/dist-packages (from spacy) (6.3.0)\n",
|
54
|
+
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from packaging>=20.0->spacy) (3.0.9)\n",
|
55
|
+
"Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.8/dist-packages (from pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4->spacy) (4.4.0)\n",
|
56
|
+
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (2.10)\n",
|
57
|
+
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (2022.12.7)\n",
|
58
|
+
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (1.24.3)\n",
|
59
|
+
"Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy) (4.0.0)\n",
|
60
|
+
"Requirement already satisfied: blis<0.8.0,>=0.7.8 in /usr/local/lib/python3.8/dist-packages (from thinc<8.2.0,>=8.1.0->spacy) (0.7.9)\n",
|
61
|
+
"Requirement already satisfied: confection<1.0.0,>=0.0.1 in /usr/local/lib/python3.8/dist-packages (from thinc<8.2.0,>=8.1.0->spacy) (0.0.3)\n",
|
62
|
+
"Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.8/dist-packages (from typer<0.8.0,>=0.3.0->spacy) (7.1.2)\n",
|
63
|
+
"Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.8/dist-packages (from jinja2->spacy) (2.0.1)\n",
|
64
|
+
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
|
65
|
+
"Requirement already satisfied: nltk in /usr/local/lib/python3.8/dist-packages (3.7)\n",
|
66
|
+
"Requirement already satisfied: regex>=2021.8.3 in /usr/local/lib/python3.8/dist-packages (from nltk) (2022.6.2)\n",
|
67
|
+
"Requirement already satisfied: tqdm in /usr/local/lib/python3.8/dist-packages (from nltk) (4.64.1)\n",
|
68
|
+
"Requirement already satisfied: click in /usr/local/lib/python3.8/dist-packages (from nltk) (7.1.2)\n",
|
69
|
+
"Requirement already satisfied: joblib in /usr/local/lib/python3.8/dist-packages (from nltk) (1.2.0)\n",
|
70
|
+
"/usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:497: UserWarning: Can't initialize NVML\n",
|
71
|
+
" warnings.warn(\"Can't initialize NVML\")\n",
|
72
|
+
"2023-01-31 10:28:37.313611: E tensorflow/stream_executor/cuda/cuda_driver.cc:271] failed call to cuInit: CUDA_ERROR_NO_DEVICE: no CUDA-capable device is detected\n",
|
73
|
+
"Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
|
74
|
+
"Collecting en-core-web-sm==3.4.1\n",
|
75
|
+
" Downloading https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-3.4.1/en_core_web_sm-3.4.1-py3-none-any.whl (12.8 MB)\n",
|
76
|
+
"\u001b[2K \u001b[90m━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━\u001b[0m \u001b[32m12.8/12.8 MB\u001b[0m \u001b[31m19.6 MB/s\u001b[0m eta \u001b[36m0:00:00\u001b[0m\n",
|
77
|
+
"\u001b[?25hRequirement already satisfied: spacy<3.5.0,>=3.4.0 in /usr/local/lib/python3.8/dist-packages (from en-core-web-sm==3.4.1) (3.4.4)\n",
|
78
|
+
"Requirement already satisfied: thinc<8.2.0,>=8.1.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (8.1.6)\n",
|
79
|
+
"Requirement already satisfied: pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (1.10.4)\n",
|
80
|
+
"Requirement already satisfied: spacy-legacy<3.1.0,>=3.0.10 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (3.0.11)\n",
|
81
|
+
"Requirement already satisfied: setuptools in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (57.4.0)\n",
|
82
|
+
"Requirement already satisfied: pathy>=0.3.5 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (0.10.1)\n",
|
83
|
+
"Requirement already satisfied: langcodes<4.0.0,>=3.2.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (3.3.0)\n",
|
84
|
+
"Requirement already satisfied: wasabi<1.1.0,>=0.9.1 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (0.10.1)\n",
|
85
|
+
"Requirement already satisfied: murmurhash<1.1.0,>=0.28.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (1.0.9)\n",
|
86
|
+
"Requirement already satisfied: preshed<3.1.0,>=3.0.2 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (3.0.8)\n",
|
87
|
+
"Requirement already satisfied: packaging>=20.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (21.3)\n",
|
88
|
+
"Requirement already satisfied: smart-open<7.0.0,>=5.2.1 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (6.3.0)\n",
|
89
|
+
"Requirement already satisfied: catalogue<2.1.0,>=2.0.6 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.0.8)\n",
|
90
|
+
"Requirement already satisfied: srsly<3.0.0,>=2.4.3 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.4.5)\n",
|
91
|
+
"Requirement already satisfied: numpy>=1.15.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (1.21.6)\n",
|
92
|
+
"Requirement already satisfied: typer<0.8.0,>=0.3.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (0.7.0)\n",
|
93
|
+
"Requirement already satisfied: spacy-loggers<2.0.0,>=1.0.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (1.0.4)\n",
|
94
|
+
"Requirement already satisfied: tqdm<5.0.0,>=4.38.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (4.64.1)\n",
|
95
|
+
"Requirement already satisfied: cymem<2.1.0,>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.0.7)\n",
|
96
|
+
"Requirement already satisfied: requests<3.0.0,>=2.13.0 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.25.1)\n",
|
97
|
+
"Requirement already satisfied: jinja2 in /usr/local/lib/python3.8/dist-packages (from spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.11.3)\n",
|
98
|
+
"Requirement already satisfied: pyparsing!=3.0.5,>=2.0.2 in /usr/local/lib/python3.8/dist-packages (from packaging>=20.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (3.0.9)\n",
|
99
|
+
"Requirement already satisfied: typing-extensions>=4.2.0 in /usr/local/lib/python3.8/dist-packages (from pydantic!=1.8,!=1.8.1,<1.11.0,>=1.7.4->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (4.4.0)\n",
|
100
|
+
"Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2022.12.7)\n",
|
101
|
+
"Requirement already satisfied: chardet<5,>=3.0.2 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (4.0.0)\n",
|
102
|
+
"Requirement already satisfied: urllib3<1.27,>=1.21.1 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (1.24.3)\n",
|
103
|
+
"Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.8/dist-packages (from requests<3.0.0,>=2.13.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.10)\n",
|
104
|
+
"Requirement already satisfied: blis<0.8.0,>=0.7.8 in /usr/local/lib/python3.8/dist-packages (from thinc<8.2.0,>=8.1.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (0.7.9)\n",
|
105
|
+
"Requirement already satisfied: confection<1.0.0,>=0.0.1 in /usr/local/lib/python3.8/dist-packages (from thinc<8.2.0,>=8.1.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (0.0.3)\n",
|
106
|
+
"Requirement already satisfied: click<9.0.0,>=7.1.1 in /usr/local/lib/python3.8/dist-packages (from typer<0.8.0,>=0.3.0->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (7.1.2)\n",
|
107
|
+
"Requirement already satisfied: MarkupSafe>=0.23 in /usr/local/lib/python3.8/dist-packages (from jinja2->spacy<3.5.0,>=3.4.0->en-core-web-sm==3.4.1) (2.0.1)\n",
|
108
|
+
"\u001b[38;5;2m✔ Download and installation successful\u001b[0m\n",
|
109
|
+
"You can now load the package via spacy.load('en_core_web_sm')\n"
|
110
|
+
]
|
111
|
+
}
|
112
|
+
],
|
113
|
+
"source": [
|
114
|
+
"! pip install spacy\n",
|
115
|
+
"! pip install nltk\n",
|
116
|
+
"! python -m spacy download en_core_web_sm"
|
117
|
+
]
|
118
|
+
},
|
119
|
+
{
|
120
|
+
"cell_type": "code",
|
121
|
+
"source": [
|
122
|
+
"import spacy\n",
|
123
|
+
"from spacy import displacy\n",
|
124
|
+
"from spacy import tokenizer\n",
|
125
|
+
"nlp = spacy.load('en_core_web_sm')"
|
126
|
+
],
|
127
|
+
"metadata": {
|
128
|
+
"colab": {
|
129
|
+
"base_uri": "https://localhost:8080/"
|
130
|
+
},
|
131
|
+
"id": "SABsAqWUXegn",
|
132
|
+
"outputId": "2f89e0c5-66b1-4b1d-b901-0551104d9488"
|
133
|
+
},
|
134
|
+
"execution_count": null,
|
135
|
+
"outputs": [
|
136
|
+
{
|
137
|
+
"output_type": "stream",
|
138
|
+
"name": "stderr",
|
139
|
+
"text": [
|
140
|
+
"/usr/local/lib/python3.8/dist-packages/torch/cuda/__init__.py:497: UserWarning: Can't initialize NVML\n",
|
141
|
+
" warnings.warn(\"Can't initialize NVML\")\n"
|
142
|
+
]
|
143
|
+
}
|
144
|
+
]
|
145
|
+
},
|
146
|
+
{
|
147
|
+
"cell_type": "code",
|
148
|
+
"source": [
|
149
|
+
"text =(\"Python is an interpreted, high-level and general-purpose programming language\"\n",
|
150
|
+
" \"Pythons design philosophy emphasizes code readability with\"\n",
|
151
|
+
" \"its notable use of significant indentation.\"\n",
|
152
|
+
" \"Its language constructs and object-oriented approach aim to\"\n",
|
153
|
+
" \"help programmers write clear and\"\n",
|
154
|
+
" \"logical code for small and large-scale projects\")"
|
155
|
+
],
|
156
|
+
"metadata": {
|
157
|
+
"id": "5P2nQrbeXjGu"
|
158
|
+
},
|
159
|
+
"execution_count": null,
|
160
|
+
"outputs": []
|
161
|
+
},
|
162
|
+
{
|
163
|
+
"cell_type": "code",
|
164
|
+
"source": [
|
165
|
+
"doc = nlp(text)\n",
|
166
|
+
"#doc2 = nlp(text2)\n",
|
167
|
+
"sentences = list(doc.sents)\n",
|
168
|
+
"print(sentences)\n",
|
169
|
+
"# tokenization\n",
|
170
|
+
"for token in doc:\n",
|
171
|
+
" print(token.text)\n",
|
172
|
+
"# print entities\n",
|
173
|
+
"ents = [(e.text, e.start_char, e.end_char, e.label_) for e in doc.ents]\n",
|
174
|
+
"print(ents)\n",
|
175
|
+
"# now we use displaycy function on doc2\n",
|
176
|
+
"displacy.render(doc, style='ent', jupyter=True)"
|
177
|
+
],
|
178
|
+
"metadata": {
|
179
|
+
"colab": {
|
180
|
+
"base_uri": "https://localhost:8080/",
|
181
|
+
"height": 975
|
182
|
+
},
|
183
|
+
"id": "J5huMlqAXmam",
|
184
|
+
"outputId": "361b18ee-7b5e-4ede-e824-c548f918555d"
|
185
|
+
},
|
186
|
+
"execution_count": null,
|
187
|
+
"outputs": [
|
188
|
+
{
|
189
|
+
"output_type": "stream",
|
190
|
+
"name": "stdout",
|
191
|
+
"text": [
|
192
|
+
"[Python is an interpreted, high-level and general-purpose programming languagePythons design philosophy emphasizes code readability withits notable use of significant indentation., Its language constructs and object-oriented approach aim tohelp programmers write clear andlogical code for small and large-scale projects]\n",
|
193
|
+
"Python\n",
|
194
|
+
"is\n",
|
195
|
+
"an\n",
|
196
|
+
"interpreted\n",
|
197
|
+
",\n",
|
198
|
+
"high\n",
|
199
|
+
"-\n",
|
200
|
+
"level\n",
|
201
|
+
"and\n",
|
202
|
+
"general\n",
|
203
|
+
"-\n",
|
204
|
+
"purpose\n",
|
205
|
+
"programming\n",
|
206
|
+
"languagePythons\n",
|
207
|
+
"design\n",
|
208
|
+
"philosophy\n",
|
209
|
+
"emphasizes\n",
|
210
|
+
"code\n",
|
211
|
+
"readability\n",
|
212
|
+
"withits\n",
|
213
|
+
"notable\n",
|
214
|
+
"use\n",
|
215
|
+
"of\n",
|
216
|
+
"significant\n",
|
217
|
+
"indentation\n",
|
218
|
+
".\n",
|
219
|
+
"Its\n",
|
220
|
+
"language\n",
|
221
|
+
"constructs\n",
|
222
|
+
"and\n",
|
223
|
+
"object\n",
|
224
|
+
"-\n",
|
225
|
+
"oriented\n",
|
226
|
+
"approach\n",
|
227
|
+
"aim\n",
|
228
|
+
"tohelp\n",
|
229
|
+
"programmers\n",
|
230
|
+
"write\n",
|
231
|
+
"clear\n",
|
232
|
+
"andlogical\n",
|
233
|
+
"code\n",
|
234
|
+
"for\n",
|
235
|
+
"small\n",
|
236
|
+
"and\n",
|
237
|
+
"large\n",
|
238
|
+
"-\n",
|
239
|
+
"scale\n",
|
240
|
+
"projects\n",
|
241
|
+
"[('languagePythons', 69, 84, 'PERSON')]\n"
|
242
|
+
]
|
243
|
+
},
|
244
|
+
{
|
245
|
+
"output_type": "display_data",
|
246
|
+
"data": {
|
247
|
+
"text/plain": [
|
248
|
+
"<IPython.core.display.HTML object>"
|
249
|
+
],
|
250
|
+
"text/html": [
|
251
|
+
"<span class=\"tex2jax_ignore\"><div class=\"entities\" style=\"line-height: 2.5; direction: ltr\">Python is an interpreted, high-level and general-purpose programming \n",
|
252
|
+
"<mark class=\"entity\" style=\"background: #aa9cfc; padding: 0.45em 0.6em; margin: 0 0.25em; line-height: 1; border-radius: 0.35em;\">\n",
|
253
|
+
" languagePythons\n",
|
254
|
+
" <span style=\"font-size: 0.8em; font-weight: bold; line-height: 1; border-radius: 0.35em; vertical-align: middle; margin-left: 0.5rem\">PERSON</span>\n",
|
255
|
+
"</mark>\n",
|
256
|
+
" design philosophy emphasizes code readability withits notable use of significant indentation.Its language constructs and object-oriented approach aim tohelp programmers write clear andlogical code for small and large-scale projects</div></span>"
|
257
|
+
]
|
258
|
+
},
|
259
|
+
"metadata": {}
|
260
|
+
}
|
261
|
+
]
|
262
|
+
},
|
263
|
+
{
|
264
|
+
"cell_type": "code",
|
265
|
+
"source": [
|
266
|
+
"import nltk\n",
|
267
|
+
"nltk.download('words')\n",
|
268
|
+
"nltk.download('punkt')\n",
|
269
|
+
"nltk.download('maxent_ne_chunker')\n",
|
270
|
+
"nltk.download('averaged_perceptron_tagger')\n",
|
271
|
+
"nltk.download('state_union')\n",
|
272
|
+
"from nltk.corpus import state_union\n",
|
273
|
+
"from nltk.tokenize import PunktSentenceTokenizer\n",
|
274
|
+
" \n",
|
275
|
+
"# process the text and print Named entities\n",
|
276
|
+
"# tokenization\n",
|
277
|
+
"train_text = state_union.raw()\n",
|
278
|
+
" \n",
|
279
|
+
"sample_text = state_union.raw(\"2006-GWBush.txt\")\n",
|
280
|
+
"custom_sent_tokenizer = PunktSentenceTokenizer(train_text)\n",
|
281
|
+
"tokenized = custom_sent_tokenizer.tokenize(sample_text)\n",
|
282
|
+
"# function"
|
283
|
+
],
|
284
|
+
"metadata": {
|
285
|
+
"colab": {
|
286
|
+
"base_uri": "https://localhost:8080/"
|
287
|
+
},
|
288
|
+
"id": "szBuYQgmYeQv",
|
289
|
+
"outputId": "28feaa55-ecf8-4842-92ff-5c5bbe390611"
|
290
|
+
},
|
291
|
+
"execution_count": null,
|
292
|
+
"outputs": [
|
293
|
+
{
|
294
|
+
"output_type": "stream",
|
295
|
+
"name": "stderr",
|
296
|
+
"text": [
|
297
|
+
"[nltk_data] Downloading package words to /root/nltk_data...\n",
|
298
|
+
"[nltk_data] Package words is already up-to-date!\n",
|
299
|
+
"[nltk_data] Downloading package punkt to /root/nltk_data...\n",
|
300
|
+
"[nltk_data] Package punkt is already up-to-date!\n",
|
301
|
+
"[nltk_data] Downloading package maxent_ne_chunker to\n",
|
302
|
+
"[nltk_data] /root/nltk_data...\n",
|
303
|
+
"[nltk_data] Package maxent_ne_chunker is already up-to-date!\n",
|
304
|
+
"[nltk_data] Downloading package averaged_perceptron_tagger to\n",
|
305
|
+
"[nltk_data] /root/nltk_data...\n",
|
306
|
+
"[nltk_data] Package averaged_perceptron_tagger is already up-to-\n",
|
307
|
+
"[nltk_data] date!\n",
|
308
|
+
"[nltk_data] Downloading package state_union to /root/nltk_data...\n",
|
309
|
+
"[nltk_data] Package state_union is already up-to-date!\n"
|
310
|
+
]
|
311
|
+
}
|
312
|
+
]
|
313
|
+
},
|
314
|
+
{
|
315
|
+
"cell_type": "code",
|
316
|
+
"source": [
|
317
|
+
"for i in tokenized:\n",
|
318
|
+
" words = nltk.word_tokenize(i)\n",
|
319
|
+
" tagged = nltk.pos_tag(words)\n",
|
320
|
+
" if(tagged[0][1]==\"NN\"):\n",
|
321
|
+
" print(tagged[0])\n",
|
322
|
+
" "
|
323
|
+
],
|
324
|
+
"metadata": {
|
325
|
+
"colab": {
|
326
|
+
"base_uri": "https://localhost:8080/"
|
327
|
+
},
|
328
|
+
"id": "qtQScPTkZzjw",
|
329
|
+
"outputId": "af00a285-434a-4f53-b406-5af7231a31e8"
|
330
|
+
},
|
331
|
+
"execution_count": null,
|
332
|
+
"outputs": [
|
333
|
+
{
|
334
|
+
"output_type": "stream",
|
335
|
+
"name": "stdout",
|
336
|
+
"text": [
|
337
|
+
"('Tonight', 'NN')\n",
|
338
|
+
"('Today', 'NN')\n",
|
339
|
+
"('Tonight', 'NN')\n",
|
340
|
+
"('Welfare', 'NN')\n",
|
341
|
+
"('Drug', 'NN')\n",
|
342
|
+
"('Today', 'NN')\n",
|
343
|
+
"('Today', 'NN')\n"
|
344
|
+
]
|
345
|
+
}
|
346
|
+
]
|
347
|
+
},
|
348
|
+
{
|
349
|
+
"cell_type": "code",
|
350
|
+
"source": [
|
351
|
+
"f=open(\"ex1nlptextdata.txt\",\"r\")\n",
|
352
|
+
"data=f.read()\n"
|
353
|
+
],
|
354
|
+
"metadata": {
|
355
|
+
"id": "64t3uZ95bFmW"
|
356
|
+
},
|
357
|
+
"execution_count": null,
|
358
|
+
"outputs": []
|
359
|
+
},
|
360
|
+
{
|
361
|
+
"cell_type": "code",
|
362
|
+
"source": [
|
363
|
+
"txtdat=data.split(\" \")\n",
|
364
|
+
"print(txtdat)"
|
365
|
+
],
|
366
|
+
"metadata": {
|
367
|
+
"colab": {
|
368
|
+
"base_uri": "https://localhost:8080/"
|
369
|
+
},
|
370
|
+
"id": "9c3WplVzdhE_",
|
371
|
+
"outputId": "58c559f7-fdfe-451b-a342-c032f74f00ef"
|
372
|
+
},
|
373
|
+
"execution_count": null,
|
374
|
+
"outputs": [
|
375
|
+
{
|
376
|
+
"output_type": "stream",
|
377
|
+
"name": "stdout",
|
378
|
+
"text": [
|
379
|
+
"['Python', 'is', 'a', 'high-level,', 'general-purpose', 'programming', 'language.', 'Its', 'design', 'philosophy', 'emphasizes', 'code', 'readability', 'with', 'the', 'use', 'of', 'significant', 'indentation.[33]\\n\\nPython', 'is', 'dynamically', 'typed', 'and', 'garbage-collected.', 'It', 'supports', 'multiple', 'programming', 'paradigms,', 'including', 'structured', '(particularly', 'procedural),', 'object-oriented', 'and', 'functional', 'programming.', '\\nRather', 'than', 'building', 'all', 'of', 'its', 'functionality', 'into', 'its', 'core,', '\\nPython', 'was', 'designed', 'to', 'be', 'highly', 'extensible', 'via', 'modules.', 'This\\ncompact', 'modularity', 'has', 'made', 'it', 'particularly', 'popular', 'as', 'a', 'means\\nof', 'adding', 'programmable', 'interfaces', 'to', 'existing', 'applications.\\nVan', \"Rossum's\", 'vision', 'of', 'a', 'small', 'core', 'language', 'with', 'a', 'large', 'standard', 'library', 'and', 'easily', 'extensible', 'interpreter', 'stemmed', 'from', 'his', 'frustrations', 'with', 'ABC,', 'which', 'espoused', 'the', 'opposite', 'approach\\n']\n"
|
380
|
+
]
|
381
|
+
}
|
382
|
+
]
|
383
|
+
},
|
384
|
+
{
|
385
|
+
"cell_type": "code",
|
386
|
+
"source": [
|
387
|
+
"for i in txtdat:\n",
|
388
|
+
" words = nltk.word_tokenize(i)\n",
|
389
|
+
" tagged = nltk.pos_tag(words)\n",
|
390
|
+
" if(tagged[0][1]==\"NN\"):\n",
|
391
|
+
" print(tagged[0])"
|
392
|
+
],
|
393
|
+
"metadata": {
|
394
|
+
"colab": {
|
395
|
+
"base_uri": "https://localhost:8080/"
|
396
|
+
},
|
397
|
+
"id": "qtfZyvXMdjc2",
|
398
|
+
"outputId": "cc15222b-b340-4140-d6f4-0c0f15c0b3e8"
|
399
|
+
},
|
400
|
+
"execution_count": null,
|
401
|
+
"outputs": [
|
402
|
+
{
|
403
|
+
"output_type": "stream",
|
404
|
+
"name": "stdout",
|
405
|
+
"text": [
|
406
|
+
"('Python', 'NN')\n",
|
407
|
+
"('high-level', 'NN')\n",
|
408
|
+
"('language', 'NN')\n",
|
409
|
+
"('design', 'NN')\n",
|
410
|
+
"('philosophy', 'NN')\n",
|
411
|
+
"('code', 'NN')\n",
|
412
|
+
"('readability', 'NN')\n",
|
413
|
+
"('use', 'NN')\n",
|
414
|
+
"('indentation', 'NN')\n",
|
415
|
+
"('multiple', 'NN')\n",
|
416
|
+
"('paradigms', 'NN')\n",
|
417
|
+
"('procedural', 'NN')\n",
|
418
|
+
"('programming', 'NN')\n",
|
419
|
+
"('building', 'NN')\n",
|
420
|
+
"('functionality', 'NN')\n",
|
421
|
+
"('core', 'NN')\n",
|
422
|
+
"('Python', 'NN')\n",
|
423
|
+
"('modularity', 'NN')\n",
|
424
|
+
"('vision', 'NN')\n",
|
425
|
+
"('core', 'NN')\n",
|
426
|
+
"('language', 'NN')\n",
|
427
|
+
"('standard', 'NN')\n",
|
428
|
+
"('library', 'NN')\n",
|
429
|
+
"('interpreter', 'NN')\n",
|
430
|
+
"('opposite', 'NN')\n",
|
431
|
+
"('approach', 'NN')\n"
|
432
|
+
]
|
433
|
+
}
|
434
|
+
]
|
435
|
+
}
|
436
|
+
]
|
437
|
+
}
|