1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
|
%global _empty_manifest_terminate_build 0
Name: python-sadedegel
Version: 0.21.2
Release: 1
Summary: Extraction-based Turkish news summarizer.
License: MIT
URL: https://github.com/GlobalMaksimum/sadedegel
Source0: https://mirrors.aliyun.com/pypi/web/packages/da/1a/138f91345a46559f8130190c83722791da5e36166acc2893a54bf97a8343/sadedegel-0.21.2.tar.gz
BuildArch: noarch
Requires: python3-loguru
Requires: python3-click
Requires: python3-smart-open
Requires: python3-uvicorn
Requires: python3-fastapi
Requires: python3-scikit-learn
Requires: python3-nltk
Requires: python3-networkx
Requires: python3-tabulate
Requires: python3-sadedegel-icu
Requires: python3-requests
Requires: python3-rich
Requires: python3-cached-property
Requires: python3-h5py
Requires: python3-sentence-transformers
Requires: python3-gensim
%description
<a href="http://sadedegel.ai"><img src="https://sadedegel.ai/assets/img/logo-2.png" width="125" height="125" align="right" /></a>
# SadedeGel: A General Purpose NLP library for Turkish
SadedeGel is initially designed to be a library for unsupervised extraction-based news summarization using several old and new NLP techniques.
Development of the library started as a part of [Açık Kaynak Hackathon Programı 2020](https://www.acikhack.com/) in which SadedeGel was the **2nd place winner**.
We are keeping on adding features with the goal of becoming a general purpose open source NLP library for Turkish language.
💫 **Version 0.21 out now!**
[Check out the release notes here.](https://github.com/GlobalMaksimum/sadedegel/releases)

[](https://img.shields.io/pypi/pyversions/sadedegel)
[](https://codecov.io/gh/globalmaksimum/sadedegel)
[](https://pypi.org/project/sadedegel/)
[](https://pypi.org/project/sadedegel/)
[](https://github.com/GlobalMaksimum/sadedegel/blob/master/LICENSE)



[](https://mybinder.org/v2/gh/GlobalMaksimum/sadedegel.git/master?filepath=notebook%2FBasics.ipynb)
[](https://join.slack.com/t/sadedegel/shared_invite/zt-h77u6aeq-VzEorB5QLHyJV90Fv4Ky3A)
[](https://www.kaggle.com/search?q=sadedegel+in%3Anotebooks)
## 📖 Documentation
| Documentation | |
| --------------- | -------------------------------------------------------------- |
| [Contribute] | How to contribute to the sadedeGel project and code base. |
[contribute]: https://github.com/GlobalMaksimum/sadedegel/blob/master/CONTRIBUTING.md
## 💬 Where to ask questions
The SadedeGel project is initialized by [@globalmaksimum](https://github.com/GlobalMaksimum) AI team members
[@dafajon](https://github.com/dafajon),
[@askarbozcan](https://github.com/askarbozcan),
[@mccakir](https://github.com/mccakir),
[@husnusensoy](https://github.com/husnusensoy) and
[@ertugruldemir](https://github.com/ertugrul-dmr).
Other community maintainers
* [@doruktiktiklar](https://github.com/doruktiktiklar) contributes [TFIDF Summarizer](sadedegel/summarize/tf_idf.py)
| Type | Platforms |
| ------------------------ | ------------------------------------------------------ |
| 🚨 **Bug Reports** | [GitHub Issue Tracker] |
| 🎁 **Feature Requests** | [GitHub Issue Tracker] |
| <img width="18" height="18" src="https://www.freeiconspng.com/uploads/slack-icon-2.png"/> **Questions** | [Slack Workspace] |
[github issue tracker]: https://github.com/GlobalMaksimum/sadedegel/issues
[Slack Workspace]: https://join.slack.com/t/sadedegel/shared_invite/zt-h77u6aeq-VzEorB5QLHyJV90Fv4Ky3A
## Features
* Several datasets
* Basic corpus
* Raw corpus (`sadedegel.dataset.load_raw_corpus`)
* Sentences tokenized corpus (`sadedegel.dataset.load_sentences_corpus`)
* Human annotated summary corpus (`sadedegel.dataset.load_annotated_corpus`)
* [Extended corpus](sadedegel/dataset/README.md)
* Raw corpus (`sadedegel.dataset.extended.load_extended_raw_corpus`)
* Sentences tokenized corpus (`sadedegel.dataset.extended.load_extended_sents_corpus`)
* TsCorpus(`sadedegel.dataset.tscorpus`)
* Thanks to [Taner Sezer](https://github.com/tanerim), over 300K documents from tscorpus is also a part of sadedegel. Allowing us to
* [Evaluate](sadedegel/bblock/TOKENIZER.md) our tokenizers (word tokenizers)
* Build our [prebuilt news category classifier](sadedegel/prebuilt/README.md)
* Various domain specific [datasets](https://github.com/GlobalMaksimum/sadedegel/tree/develop/sadedegel/dataset) (e-commerce, social media, tourism etc.)
* ML based sentence boundary detector (**SBD**) trained for Turkish language
* Sadedegel Extractive Summarizers
* Various baseline summarizers
* Position Summarizer
* Length Summarizer
* Band Summarizer
* Random Summarizer
* Various unsupervised/supervised summarizers
* ROUGE1 Summarizer
* TextRank Summarizer
* Cluster Summarizer
* Lexrank Summarizer
* BM25 Summarizer
* TfIdf Summarizer
* Various Word Tokenizers
* BERT Tokenizer - Trained tokenizer (`pip install sadedegel[bert]`)
* Simple Tokenizer - Regex Based
* IcU Tokenizer (default by `0.19`)
* Various Sparse and Dense Embeddings implemented for `Sentences` and `Document` objects.
* BERT Embeddings (`pip install sadedegel[bert]`)
* TfIdf Embeddings
* Word Vectors for your tokens (`pip install sadedegel[w2v]`)
* A `sklearn` compatible [Feature Extraction API](https://github.com/GlobalMaksimum/sadedegel/tree/develop/sadedegel/extension)
* Word Vectors for your tokens (`pip install sadedegel[w2v]`)
* A `sklearn` compatible [Feature Extraction API](https://github.com/GlobalMaksimum/sadedegel/tree/develop/sadedegel/extension)
* [**Experimental**] Prebuilt models for several common NLP tasks ([`sadedegel.prebuilt`](sadedegel/prebuilt/README.md)).
```python
from sadedegel.prebuilt import news_classification
model = news_classification.load()
doc_str = ("Bilişim sektörü, günlük devrimlerin yaşandığı ve hızına yetişilemeyen dev bir alan haline geleli uzun bir zaman olmadı. Günümüz bilgisayarlarının tarihi, yarım asırı yeni tamamlarken; yaşanan gelişmeler çok "
"daha büyük ölçekte. Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu. IBM 650 Model I adını taşıyan bilgisayarın "
"satın alınma amacı ise yol yapımında gereken hesaplamaların daha hızlı yapılmasıydı. Türkiye’nin ilk bilgisayar destekli karayolu olan 63 km uzunluğundaki Polatlı - Sivrihisar yolu için yapılan hesaplamalar IBM 650 ile 1 saatte yapıldı. "
"Daha öncesinde 3 - 4 ayı bulan hesaplamaların 1 saate inmesi; teknolojinin, ekonomik ve toplumsal dönüşüme büyük etkide bulunacağının habercisiydi.")
y_pred = model.predict([doc_str])
```
📖 **For more details, refer to [sadedegel.ai](http://sadedegel.ai)**
## Install sadedeGel
- **Operating system**: macOS / OS X · Linux · Windows (Cygwin, MinGW, Visual
Studio)
- **Python version**: 3.6+ (only 64 bit)
- **Package managers**: [pip]
[pip]: https://pypi.org/project/sadedegel/
### pip
Using pip, sadedeGel releases are available as source packages and binary wheels.
```bash
pip install sadedegel
```
or update now
```bash
pip install sadedegel -U
```
When using pip it is generally recommended to install packages in a virtual
environment to avoid modifying system state:
```bash
python -m venv .env
source .env/bin/activate
pip install sadedegel
```
#### Vocabulary Dump
Certaing attributes of SadedeGel's NLP objects are dependent on shipped vocabulary dumps that are created over `sadedegel.dataset.extened_corpus` via each of the existing SadedeGel tokenizers. Those tokenizers are listed above. If you want to re-train a specific tokenizer's vocabulary with custom settings:
```bash
python -m sadedegel.bblock.cli build-vocabulary -t [bert|icu|simple]
```
This will create a vocabulary dump using `sadedegel.dataset.extended_corpus` based on custom user settings.
For all options to customize your vocab dump refer to:
```bash
python -m sadedegel.bblock.cli build-vocabulary --help
```
#### Optional
To keep core sadedegel as light as possible we decomposed our initial monolitic design.
To enable BERT embeddings and related capabilities use
```bash
pip install sadedegel[bert]
```
We ship 100-dimension word vectors with the library. If you need to re-train those word embeddings you can use
```bash
python -m sadedegel.bblock.cli build-vocabulary -t [bert|icu|simple] --w2v
```
`--w2v` option requires `w2v` option to be installed. To install option use
This will create a vocabulary dump with keyed vectors of arbitrary size using `sadedegel.dataset.extended_corpus` based on custom user settings.
```bash
pip install sadedegel[w2v]
```
### Quickstart with SadedeGel
To load SadedeGel, use `sadedegel.load()`
```python
from sadedegel import Doc
from sadedegel.dataset import load_raw_corpus
from sadedegel.summarize import Rouge1Summarizer
raw = load_raw_corpus()
d = Doc(next(raw))
summarizer = Rouge1Summarizer()
summarizer(d, k=5)
```
To trigger sadedeGel NLP pipeline, initialize `Doc` instance with a document string.
Access all sentences using Python built-in `list` function.
```python
from sadedegel import Doc
doc_str = ("Bilişim sektörü, günlük devrimlerin yaşandığı ve hızına yetişilemeyen dev bir alan haline geleli uzun bir zaman olmadı. Günümüz bilgisayarlarının tarihi, yarım asırı yeni tamamlarken; yaşanan gelişmeler çok "
"daha büyük ölçekte. Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu. IBM 650 Model I adını taşıyan bilgisayarın "
"satın alınma amacı ise yol yapımında gereken hesaplamaların daha hızlı yapılmasıydı. Türkiye’nin ilk bilgisayar destekli karayolu olan 63 km uzunluğundaki Polatlı - Sivrihisar yolu için yapılan hesaplamalar IBM 650 ile 1 saatte yapıldı. "
"Daha öncesinde 3 - 4 ayı bulan hesaplamaların 1 saate inmesi; teknolojinin, ekonomik ve toplumsal dönüşüme büyük etkide bulunacağının habercisiydi.")
doc = Doc(doc_str)
list(doc)
```
```python
['Bilişim sektörü, günlük devrimlerin yaşandığı ve hızına yetişilemeyen dev bir alan haline geleli uzun bir zaman olmadı.',
'Günümüz bilgisayarlarının tarihi, yarım asırı yeni tamamlarken; yaşanan gelişmeler çok daha büyük ölçekte.',
'Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu.',
'IBM 650 Model I adını taşıyan bilgisayarın satın alınma amacı ise yol yapımında gereken hesaplamaların daha hızlı yapılmasıydı.',
'Türkiye’nin ilk bilgisayar destekli karayolu olan 63 km uzunluğundaki Polatlı - Sivrihisar yolu için yapılan hesaplamalar IBM 650 ile 1 saatte yapıldı.',
'Daha öncesinde 3 - 4 ayı bulan hesaplamaların 1 saate inmesi; teknolojinin, ekonomik ve toplumsal dönüşüme büyük etkide bulunacağının habercisiydi.']
```
Access sentences by index.
```python
doc[2]
```
```python
Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu.
```
## SadedeGel Server
In order to integrate with your applications we provide a quick summarizer server with sadedeGel.
```bash
python3 -m sadedegel.server
```
### SadedeGel Server on Heroku
[SadedeGel Server](https://sadedegel.herokuapp.com/api/info) is hosted on free tier of [Heroku](https://heroku.com) cloud services.
* [OpenAPI Documentation](https://sadedegel.herokuapp.com/docs)
* [Redoc Documentation](https://sadedegel.herokuapp.com/redoc)
* [Redirection to sadedegel.ai](https://sadedegel.herokuapp.com)
## PyLint, Flake8 and Bandit
sadedeGel utilized [pylint](https://www.pylint.org/) for static code analysis,
[flake8](https://flake8.pycqa.org/en/latest) for code styling and [bandit](https://pypi.org/project/bandit)
for code security check.
To run all tests
```bash
make lint
```
## Run tests
sadedeGel comes with an [extensive test suite](sadedegel/tests). In order to run the
tests, you'll usually want to clone the repository and build sadedeGel from source.
This will also install the required development dependencies and test utilities
defined in the `requirements.txt`.
Alternatively, you can find out where sadedeGel is installed and run `pytest` on
that directory. Don't forget to also install the test utilities via sadedeGel's
`requirements.txt`:
```bash
make test
```
## 📓 Kaggle
* Check [comprehensive notebook](https://www.kaggle.com/datafan07/clickbait-news-classification-using-sadedegel) of Kaggle Master [Ertugrul Demir](https://www.kaggle.com/datafan07) explaining the capabilities of sadedegel on Turkish clickbate dataset
## Youtube Channel
Some videos from [sadedeGel YouTube Channel](https://www.youtube.com/channel/UCyNG1Mehl44XWZ8LzkColuw)
### SkyLab YTU Webinar Playlist
[&style=social&withDislikes)](https://www.youtube.com/watch?v=xoEERspk6Is)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=HfWIzAwf5u8)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=PkUmYhahiMw)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=AxpK7fOndRQ)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=jKh_t9ZOJ-g)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=3DO1X7de1FI)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=KGg3DJQVH9c)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=G_erifsGGFs)
## References
### Special Thanks
* [Starlang Software](https://starlangyazilim.com/) for their contribution to open source Turkish NLP development and corpus preperation.
* [Olcay Taner Yıldız, Ph.D.](https://github.com/olcaytaner), one of our refrees in [Açık Kaynak Hackathon Programı 2020](https://www.acikhack.com/), for helping our development on sadedegel.
* [Taner Sezer](https://github.com/tanerim) for his contribution on tokenization corpus and labeled news corpus.
### Our Community Contributors
We would like to thank our community contributors for their bug/enhancement requests and questions to make sadedeGel better everyday
* [Burak Işıklı](https://github.com/burakisikli)
### Software Engineering
* Special thanks to [spaCy](https://github.com/explosion/spaCy) project for their work in showing us the way to implement a proper python module rather than merely explaining it.
* We have borrowed many document and style related stuff from their code base :smile:
* There are a few free-tier service providers we need to thank:
* [GitHub](https://github.com) for
* Hosting our projects.
* Making it possible to collobrate easily.
* Automating our SLM via [Github Actions](https://github.com/features/actions)
* [Google Cloud Google Storage Service](https://cloud.google.com/products/storage) for providing low cost storage buckets making it possible to store `sadedegel.dataset.extended` data.
* [Heroku](https://heroku.com) for hosting [sadedeGel Server](https://sadedegel.herokuapp.com/api/info) in their free tier dynos.
* [CodeCov](https://codecov.io/) for allowing us to transparently share our [test coverage](https://codecov.io/gh/globalmaksimum/sadedegel)
* [PyPI](https://pypi.org/) for allowing us to share [sadedegel](https://pypi.org/project/sadedegel) with you.
* [binder](https://mybinder.org/) for
* Allowing us to share our example [notebooks](notebook/)
* Hosting our learn by example boxes in [sadedegel.ai](http://sadedegel.ai)
### Machine Learning (ML), Deep Learning (DL) and Natural Language Processing (NLP)
* Resources on Extractive Text Summarization:
* [Leveraging BERT for Extractive Text Summarization on Lectures](https://arxiv.org/abs/1906.04165) by Derek Miller
* [Fine-tune BERT for Extractive Summarization](https://arxiv.org/pdf/1903.10318.pdf) by Yang Liu
* Other NLP related references
* [ROUGE: A Package for Automatic Evaluation of Summaries](https://www.aclweb.org/anthology/W04-1013.pdf)
* [Speech and Language Processing, Second Edition](https://web.stanford.edu/~jurafsky/slp3/)
%package -n python3-sadedegel
Summary: Extraction-based Turkish news summarizer.
Provides: python-sadedegel
BuildRequires: python3-devel
BuildRequires: python3-setuptools
BuildRequires: python3-pip
%description -n python3-sadedegel
<a href="http://sadedegel.ai"><img src="https://sadedegel.ai/assets/img/logo-2.png" width="125" height="125" align="right" /></a>
# SadedeGel: A General Purpose NLP library for Turkish
SadedeGel is initially designed to be a library for unsupervised extraction-based news summarization using several old and new NLP techniques.
Development of the library started as a part of [Açık Kaynak Hackathon Programı 2020](https://www.acikhack.com/) in which SadedeGel was the **2nd place winner**.
We are keeping on adding features with the goal of becoming a general purpose open source NLP library for Turkish language.
💫 **Version 0.21 out now!**
[Check out the release notes here.](https://github.com/GlobalMaksimum/sadedegel/releases)

[](https://img.shields.io/pypi/pyversions/sadedegel)
[](https://codecov.io/gh/globalmaksimum/sadedegel)
[](https://pypi.org/project/sadedegel/)
[](https://pypi.org/project/sadedegel/)
[](https://github.com/GlobalMaksimum/sadedegel/blob/master/LICENSE)



[](https://mybinder.org/v2/gh/GlobalMaksimum/sadedegel.git/master?filepath=notebook%2FBasics.ipynb)
[](https://join.slack.com/t/sadedegel/shared_invite/zt-h77u6aeq-VzEorB5QLHyJV90Fv4Ky3A)
[](https://www.kaggle.com/search?q=sadedegel+in%3Anotebooks)
## 📖 Documentation
| Documentation | |
| --------------- | -------------------------------------------------------------- |
| [Contribute] | How to contribute to the sadedeGel project and code base. |
[contribute]: https://github.com/GlobalMaksimum/sadedegel/blob/master/CONTRIBUTING.md
## 💬 Where to ask questions
The SadedeGel project is initialized by [@globalmaksimum](https://github.com/GlobalMaksimum) AI team members
[@dafajon](https://github.com/dafajon),
[@askarbozcan](https://github.com/askarbozcan),
[@mccakir](https://github.com/mccakir),
[@husnusensoy](https://github.com/husnusensoy) and
[@ertugruldemir](https://github.com/ertugrul-dmr).
Other community maintainers
* [@doruktiktiklar](https://github.com/doruktiktiklar) contributes [TFIDF Summarizer](sadedegel/summarize/tf_idf.py)
| Type | Platforms |
| ------------------------ | ------------------------------------------------------ |
| 🚨 **Bug Reports** | [GitHub Issue Tracker] |
| 🎁 **Feature Requests** | [GitHub Issue Tracker] |
| <img width="18" height="18" src="https://www.freeiconspng.com/uploads/slack-icon-2.png"/> **Questions** | [Slack Workspace] |
[github issue tracker]: https://github.com/GlobalMaksimum/sadedegel/issues
[Slack Workspace]: https://join.slack.com/t/sadedegel/shared_invite/zt-h77u6aeq-VzEorB5QLHyJV90Fv4Ky3A
## Features
* Several datasets
* Basic corpus
* Raw corpus (`sadedegel.dataset.load_raw_corpus`)
* Sentences tokenized corpus (`sadedegel.dataset.load_sentences_corpus`)
* Human annotated summary corpus (`sadedegel.dataset.load_annotated_corpus`)
* [Extended corpus](sadedegel/dataset/README.md)
* Raw corpus (`sadedegel.dataset.extended.load_extended_raw_corpus`)
* Sentences tokenized corpus (`sadedegel.dataset.extended.load_extended_sents_corpus`)
* TsCorpus(`sadedegel.dataset.tscorpus`)
* Thanks to [Taner Sezer](https://github.com/tanerim), over 300K documents from tscorpus is also a part of sadedegel. Allowing us to
* [Evaluate](sadedegel/bblock/TOKENIZER.md) our tokenizers (word tokenizers)
* Build our [prebuilt news category classifier](sadedegel/prebuilt/README.md)
* Various domain specific [datasets](https://github.com/GlobalMaksimum/sadedegel/tree/develop/sadedegel/dataset) (e-commerce, social media, tourism etc.)
* ML based sentence boundary detector (**SBD**) trained for Turkish language
* Sadedegel Extractive Summarizers
* Various baseline summarizers
* Position Summarizer
* Length Summarizer
* Band Summarizer
* Random Summarizer
* Various unsupervised/supervised summarizers
* ROUGE1 Summarizer
* TextRank Summarizer
* Cluster Summarizer
* Lexrank Summarizer
* BM25 Summarizer
* TfIdf Summarizer
* Various Word Tokenizers
* BERT Tokenizer - Trained tokenizer (`pip install sadedegel[bert]`)
* Simple Tokenizer - Regex Based
* IcU Tokenizer (default by `0.19`)
* Various Sparse and Dense Embeddings implemented for `Sentences` and `Document` objects.
* BERT Embeddings (`pip install sadedegel[bert]`)
* TfIdf Embeddings
* Word Vectors for your tokens (`pip install sadedegel[w2v]`)
* A `sklearn` compatible [Feature Extraction API](https://github.com/GlobalMaksimum/sadedegel/tree/develop/sadedegel/extension)
* Word Vectors for your tokens (`pip install sadedegel[w2v]`)
* A `sklearn` compatible [Feature Extraction API](https://github.com/GlobalMaksimum/sadedegel/tree/develop/sadedegel/extension)
* [**Experimental**] Prebuilt models for several common NLP tasks ([`sadedegel.prebuilt`](sadedegel/prebuilt/README.md)).
```python
from sadedegel.prebuilt import news_classification
model = news_classification.load()
doc_str = ("Bilişim sektörü, günlük devrimlerin yaşandığı ve hızına yetişilemeyen dev bir alan haline geleli uzun bir zaman olmadı. Günümüz bilgisayarlarının tarihi, yarım asırı yeni tamamlarken; yaşanan gelişmeler çok "
"daha büyük ölçekte. Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu. IBM 650 Model I adını taşıyan bilgisayarın "
"satın alınma amacı ise yol yapımında gereken hesaplamaların daha hızlı yapılmasıydı. Türkiye’nin ilk bilgisayar destekli karayolu olan 63 km uzunluğundaki Polatlı - Sivrihisar yolu için yapılan hesaplamalar IBM 650 ile 1 saatte yapıldı. "
"Daha öncesinde 3 - 4 ayı bulan hesaplamaların 1 saate inmesi; teknolojinin, ekonomik ve toplumsal dönüşüme büyük etkide bulunacağının habercisiydi.")
y_pred = model.predict([doc_str])
```
📖 **For more details, refer to [sadedegel.ai](http://sadedegel.ai)**
## Install sadedeGel
- **Operating system**: macOS / OS X · Linux · Windows (Cygwin, MinGW, Visual
Studio)
- **Python version**: 3.6+ (only 64 bit)
- **Package managers**: [pip]
[pip]: https://pypi.org/project/sadedegel/
### pip
Using pip, sadedeGel releases are available as source packages and binary wheels.
```bash
pip install sadedegel
```
or update now
```bash
pip install sadedegel -U
```
When using pip it is generally recommended to install packages in a virtual
environment to avoid modifying system state:
```bash
python -m venv .env
source .env/bin/activate
pip install sadedegel
```
#### Vocabulary Dump
Certaing attributes of SadedeGel's NLP objects are dependent on shipped vocabulary dumps that are created over `sadedegel.dataset.extened_corpus` via each of the existing SadedeGel tokenizers. Those tokenizers are listed above. If you want to re-train a specific tokenizer's vocabulary with custom settings:
```bash
python -m sadedegel.bblock.cli build-vocabulary -t [bert|icu|simple]
```
This will create a vocabulary dump using `sadedegel.dataset.extended_corpus` based on custom user settings.
For all options to customize your vocab dump refer to:
```bash
python -m sadedegel.bblock.cli build-vocabulary --help
```
#### Optional
To keep core sadedegel as light as possible we decomposed our initial monolitic design.
To enable BERT embeddings and related capabilities use
```bash
pip install sadedegel[bert]
```
We ship 100-dimension word vectors with the library. If you need to re-train those word embeddings you can use
```bash
python -m sadedegel.bblock.cli build-vocabulary -t [bert|icu|simple] --w2v
```
`--w2v` option requires `w2v` option to be installed. To install option use
This will create a vocabulary dump with keyed vectors of arbitrary size using `sadedegel.dataset.extended_corpus` based on custom user settings.
```bash
pip install sadedegel[w2v]
```
### Quickstart with SadedeGel
To load SadedeGel, use `sadedegel.load()`
```python
from sadedegel import Doc
from sadedegel.dataset import load_raw_corpus
from sadedegel.summarize import Rouge1Summarizer
raw = load_raw_corpus()
d = Doc(next(raw))
summarizer = Rouge1Summarizer()
summarizer(d, k=5)
```
To trigger sadedeGel NLP pipeline, initialize `Doc` instance with a document string.
Access all sentences using Python built-in `list` function.
```python
from sadedegel import Doc
doc_str = ("Bilişim sektörü, günlük devrimlerin yaşandığı ve hızına yetişilemeyen dev bir alan haline geleli uzun bir zaman olmadı. Günümüz bilgisayarlarının tarihi, yarım asırı yeni tamamlarken; yaşanan gelişmeler çok "
"daha büyük ölçekte. Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu. IBM 650 Model I adını taşıyan bilgisayarın "
"satın alınma amacı ise yol yapımında gereken hesaplamaların daha hızlı yapılmasıydı. Türkiye’nin ilk bilgisayar destekli karayolu olan 63 km uzunluğundaki Polatlı - Sivrihisar yolu için yapılan hesaplamalar IBM 650 ile 1 saatte yapıldı. "
"Daha öncesinde 3 - 4 ayı bulan hesaplamaların 1 saate inmesi; teknolojinin, ekonomik ve toplumsal dönüşüme büyük etkide bulunacağının habercisiydi.")
doc = Doc(doc_str)
list(doc)
```
```python
['Bilişim sektörü, günlük devrimlerin yaşandığı ve hızına yetişilemeyen dev bir alan haline geleli uzun bir zaman olmadı.',
'Günümüz bilgisayarlarının tarihi, yarım asırı yeni tamamlarken; yaşanan gelişmeler çok daha büyük ölçekte.',
'Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu.',
'IBM 650 Model I adını taşıyan bilgisayarın satın alınma amacı ise yol yapımında gereken hesaplamaların daha hızlı yapılmasıydı.',
'Türkiye’nin ilk bilgisayar destekli karayolu olan 63 km uzunluğundaki Polatlı - Sivrihisar yolu için yapılan hesaplamalar IBM 650 ile 1 saatte yapıldı.',
'Daha öncesinde 3 - 4 ayı bulan hesaplamaların 1 saate inmesi; teknolojinin, ekonomik ve toplumsal dönüşüme büyük etkide bulunacağının habercisiydi.']
```
Access sentences by index.
```python
doc[2]
```
```python
Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu.
```
## SadedeGel Server
In order to integrate with your applications we provide a quick summarizer server with sadedeGel.
```bash
python3 -m sadedegel.server
```
### SadedeGel Server on Heroku
[SadedeGel Server](https://sadedegel.herokuapp.com/api/info) is hosted on free tier of [Heroku](https://heroku.com) cloud services.
* [OpenAPI Documentation](https://sadedegel.herokuapp.com/docs)
* [Redoc Documentation](https://sadedegel.herokuapp.com/redoc)
* [Redirection to sadedegel.ai](https://sadedegel.herokuapp.com)
## PyLint, Flake8 and Bandit
sadedeGel utilized [pylint](https://www.pylint.org/) for static code analysis,
[flake8](https://flake8.pycqa.org/en/latest) for code styling and [bandit](https://pypi.org/project/bandit)
for code security check.
To run all tests
```bash
make lint
```
## Run tests
sadedeGel comes with an [extensive test suite](sadedegel/tests). In order to run the
tests, you'll usually want to clone the repository and build sadedeGel from source.
This will also install the required development dependencies and test utilities
defined in the `requirements.txt`.
Alternatively, you can find out where sadedeGel is installed and run `pytest` on
that directory. Don't forget to also install the test utilities via sadedeGel's
`requirements.txt`:
```bash
make test
```
## 📓 Kaggle
* Check [comprehensive notebook](https://www.kaggle.com/datafan07/clickbait-news-classification-using-sadedegel) of Kaggle Master [Ertugrul Demir](https://www.kaggle.com/datafan07) explaining the capabilities of sadedegel on Turkish clickbate dataset
## Youtube Channel
Some videos from [sadedeGel YouTube Channel](https://www.youtube.com/channel/UCyNG1Mehl44XWZ8LzkColuw)
### SkyLab YTU Webinar Playlist
[&style=social&withDislikes)](https://www.youtube.com/watch?v=xoEERspk6Is)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=HfWIzAwf5u8)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=PkUmYhahiMw)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=AxpK7fOndRQ)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=jKh_t9ZOJ-g)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=3DO1X7de1FI)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=KGg3DJQVH9c)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=G_erifsGGFs)
## References
### Special Thanks
* [Starlang Software](https://starlangyazilim.com/) for their contribution to open source Turkish NLP development and corpus preperation.
* [Olcay Taner Yıldız, Ph.D.](https://github.com/olcaytaner), one of our refrees in [Açık Kaynak Hackathon Programı 2020](https://www.acikhack.com/), for helping our development on sadedegel.
* [Taner Sezer](https://github.com/tanerim) for his contribution on tokenization corpus and labeled news corpus.
### Our Community Contributors
We would like to thank our community contributors for their bug/enhancement requests and questions to make sadedeGel better everyday
* [Burak Işıklı](https://github.com/burakisikli)
### Software Engineering
* Special thanks to [spaCy](https://github.com/explosion/spaCy) project for their work in showing us the way to implement a proper python module rather than merely explaining it.
* We have borrowed many document and style related stuff from their code base :smile:
* There are a few free-tier service providers we need to thank:
* [GitHub](https://github.com) for
* Hosting our projects.
* Making it possible to collobrate easily.
* Automating our SLM via [Github Actions](https://github.com/features/actions)
* [Google Cloud Google Storage Service](https://cloud.google.com/products/storage) for providing low cost storage buckets making it possible to store `sadedegel.dataset.extended` data.
* [Heroku](https://heroku.com) for hosting [sadedeGel Server](https://sadedegel.herokuapp.com/api/info) in their free tier dynos.
* [CodeCov](https://codecov.io/) for allowing us to transparently share our [test coverage](https://codecov.io/gh/globalmaksimum/sadedegel)
* [PyPI](https://pypi.org/) for allowing us to share [sadedegel](https://pypi.org/project/sadedegel) with you.
* [binder](https://mybinder.org/) for
* Allowing us to share our example [notebooks](notebook/)
* Hosting our learn by example boxes in [sadedegel.ai](http://sadedegel.ai)
### Machine Learning (ML), Deep Learning (DL) and Natural Language Processing (NLP)
* Resources on Extractive Text Summarization:
* [Leveraging BERT for Extractive Text Summarization on Lectures](https://arxiv.org/abs/1906.04165) by Derek Miller
* [Fine-tune BERT for Extractive Summarization](https://arxiv.org/pdf/1903.10318.pdf) by Yang Liu
* Other NLP related references
* [ROUGE: A Package for Automatic Evaluation of Summaries](https://www.aclweb.org/anthology/W04-1013.pdf)
* [Speech and Language Processing, Second Edition](https://web.stanford.edu/~jurafsky/slp3/)
%package help
Summary: Development documents and examples for sadedegel
Provides: python3-sadedegel-doc
%description help
<a href="http://sadedegel.ai"><img src="https://sadedegel.ai/assets/img/logo-2.png" width="125" height="125" align="right" /></a>
# SadedeGel: A General Purpose NLP library for Turkish
SadedeGel is initially designed to be a library for unsupervised extraction-based news summarization using several old and new NLP techniques.
Development of the library started as a part of [Açık Kaynak Hackathon Programı 2020](https://www.acikhack.com/) in which SadedeGel was the **2nd place winner**.
We are keeping on adding features with the goal of becoming a general purpose open source NLP library for Turkish language.
💫 **Version 0.21 out now!**
[Check out the release notes here.](https://github.com/GlobalMaksimum/sadedegel/releases)

[](https://img.shields.io/pypi/pyversions/sadedegel)
[](https://codecov.io/gh/globalmaksimum/sadedegel)
[](https://pypi.org/project/sadedegel/)
[](https://pypi.org/project/sadedegel/)
[](https://github.com/GlobalMaksimum/sadedegel/blob/master/LICENSE)



[](https://mybinder.org/v2/gh/GlobalMaksimum/sadedegel.git/master?filepath=notebook%2FBasics.ipynb)
[](https://join.slack.com/t/sadedegel/shared_invite/zt-h77u6aeq-VzEorB5QLHyJV90Fv4Ky3A)
[](https://www.kaggle.com/search?q=sadedegel+in%3Anotebooks)
## 📖 Documentation
| Documentation | |
| --------------- | -------------------------------------------------------------- |
| [Contribute] | How to contribute to the sadedeGel project and code base. |
[contribute]: https://github.com/GlobalMaksimum/sadedegel/blob/master/CONTRIBUTING.md
## 💬 Where to ask questions
The SadedeGel project is initialized by [@globalmaksimum](https://github.com/GlobalMaksimum) AI team members
[@dafajon](https://github.com/dafajon),
[@askarbozcan](https://github.com/askarbozcan),
[@mccakir](https://github.com/mccakir),
[@husnusensoy](https://github.com/husnusensoy) and
[@ertugruldemir](https://github.com/ertugrul-dmr).
Other community maintainers
* [@doruktiktiklar](https://github.com/doruktiktiklar) contributes [TFIDF Summarizer](sadedegel/summarize/tf_idf.py)
| Type | Platforms |
| ------------------------ | ------------------------------------------------------ |
| 🚨 **Bug Reports** | [GitHub Issue Tracker] |
| 🎁 **Feature Requests** | [GitHub Issue Tracker] |
| <img width="18" height="18" src="https://www.freeiconspng.com/uploads/slack-icon-2.png"/> **Questions** | [Slack Workspace] |
[github issue tracker]: https://github.com/GlobalMaksimum/sadedegel/issues
[Slack Workspace]: https://join.slack.com/t/sadedegel/shared_invite/zt-h77u6aeq-VzEorB5QLHyJV90Fv4Ky3A
## Features
* Several datasets
* Basic corpus
* Raw corpus (`sadedegel.dataset.load_raw_corpus`)
* Sentences tokenized corpus (`sadedegel.dataset.load_sentences_corpus`)
* Human annotated summary corpus (`sadedegel.dataset.load_annotated_corpus`)
* [Extended corpus](sadedegel/dataset/README.md)
* Raw corpus (`sadedegel.dataset.extended.load_extended_raw_corpus`)
* Sentences tokenized corpus (`sadedegel.dataset.extended.load_extended_sents_corpus`)
* TsCorpus(`sadedegel.dataset.tscorpus`)
* Thanks to [Taner Sezer](https://github.com/tanerim), over 300K documents from tscorpus is also a part of sadedegel. Allowing us to
* [Evaluate](sadedegel/bblock/TOKENIZER.md) our tokenizers (word tokenizers)
* Build our [prebuilt news category classifier](sadedegel/prebuilt/README.md)
* Various domain specific [datasets](https://github.com/GlobalMaksimum/sadedegel/tree/develop/sadedegel/dataset) (e-commerce, social media, tourism etc.)
* ML based sentence boundary detector (**SBD**) trained for Turkish language
* Sadedegel Extractive Summarizers
* Various baseline summarizers
* Position Summarizer
* Length Summarizer
* Band Summarizer
* Random Summarizer
* Various unsupervised/supervised summarizers
* ROUGE1 Summarizer
* TextRank Summarizer
* Cluster Summarizer
* Lexrank Summarizer
* BM25 Summarizer
* TfIdf Summarizer
* Various Word Tokenizers
* BERT Tokenizer - Trained tokenizer (`pip install sadedegel[bert]`)
* Simple Tokenizer - Regex Based
* IcU Tokenizer (default by `0.19`)
* Various Sparse and Dense Embeddings implemented for `Sentences` and `Document` objects.
* BERT Embeddings (`pip install sadedegel[bert]`)
* TfIdf Embeddings
* Word Vectors for your tokens (`pip install sadedegel[w2v]`)
* A `sklearn` compatible [Feature Extraction API](https://github.com/GlobalMaksimum/sadedegel/tree/develop/sadedegel/extension)
* Word Vectors for your tokens (`pip install sadedegel[w2v]`)
* A `sklearn` compatible [Feature Extraction API](https://github.com/GlobalMaksimum/sadedegel/tree/develop/sadedegel/extension)
* [**Experimental**] Prebuilt models for several common NLP tasks ([`sadedegel.prebuilt`](sadedegel/prebuilt/README.md)).
```python
from sadedegel.prebuilt import news_classification
model = news_classification.load()
doc_str = ("Bilişim sektörü, günlük devrimlerin yaşandığı ve hızına yetişilemeyen dev bir alan haline geleli uzun bir zaman olmadı. Günümüz bilgisayarlarının tarihi, yarım asırı yeni tamamlarken; yaşanan gelişmeler çok "
"daha büyük ölçekte. Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu. IBM 650 Model I adını taşıyan bilgisayarın "
"satın alınma amacı ise yol yapımında gereken hesaplamaların daha hızlı yapılmasıydı. Türkiye’nin ilk bilgisayar destekli karayolu olan 63 km uzunluğundaki Polatlı - Sivrihisar yolu için yapılan hesaplamalar IBM 650 ile 1 saatte yapıldı. "
"Daha öncesinde 3 - 4 ayı bulan hesaplamaların 1 saate inmesi; teknolojinin, ekonomik ve toplumsal dönüşüme büyük etkide bulunacağının habercisiydi.")
y_pred = model.predict([doc_str])
```
📖 **For more details, refer to [sadedegel.ai](http://sadedegel.ai)**
## Install sadedeGel
- **Operating system**: macOS / OS X · Linux · Windows (Cygwin, MinGW, Visual
Studio)
- **Python version**: 3.6+ (only 64 bit)
- **Package managers**: [pip]
[pip]: https://pypi.org/project/sadedegel/
### pip
Using pip, sadedeGel releases are available as source packages and binary wheels.
```bash
pip install sadedegel
```
or update now
```bash
pip install sadedegel -U
```
When using pip it is generally recommended to install packages in a virtual
environment to avoid modifying system state:
```bash
python -m venv .env
source .env/bin/activate
pip install sadedegel
```
#### Vocabulary Dump
Certaing attributes of SadedeGel's NLP objects are dependent on shipped vocabulary dumps that are created over `sadedegel.dataset.extened_corpus` via each of the existing SadedeGel tokenizers. Those tokenizers are listed above. If you want to re-train a specific tokenizer's vocabulary with custom settings:
```bash
python -m sadedegel.bblock.cli build-vocabulary -t [bert|icu|simple]
```
This will create a vocabulary dump using `sadedegel.dataset.extended_corpus` based on custom user settings.
For all options to customize your vocab dump refer to:
```bash
python -m sadedegel.bblock.cli build-vocabulary --help
```
#### Optional
To keep core sadedegel as light as possible we decomposed our initial monolitic design.
To enable BERT embeddings and related capabilities use
```bash
pip install sadedegel[bert]
```
We ship 100-dimension word vectors with the library. If you need to re-train those word embeddings you can use
```bash
python -m sadedegel.bblock.cli build-vocabulary -t [bert|icu|simple] --w2v
```
`--w2v` option requires `w2v` option to be installed. To install option use
This will create a vocabulary dump with keyed vectors of arbitrary size using `sadedegel.dataset.extended_corpus` based on custom user settings.
```bash
pip install sadedegel[w2v]
```
### Quickstart with SadedeGel
To load SadedeGel, use `sadedegel.load()`
```python
from sadedegel import Doc
from sadedegel.dataset import load_raw_corpus
from sadedegel.summarize import Rouge1Summarizer
raw = load_raw_corpus()
d = Doc(next(raw))
summarizer = Rouge1Summarizer()
summarizer(d, k=5)
```
To trigger sadedeGel NLP pipeline, initialize `Doc` instance with a document string.
Access all sentences using Python built-in `list` function.
```python
from sadedegel import Doc
doc_str = ("Bilişim sektörü, günlük devrimlerin yaşandığı ve hızına yetişilemeyen dev bir alan haline geleli uzun bir zaman olmadı. Günümüz bilgisayarlarının tarihi, yarım asırı yeni tamamlarken; yaşanan gelişmeler çok "
"daha büyük ölçekte. Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu. IBM 650 Model I adını taşıyan bilgisayarın "
"satın alınma amacı ise yol yapımında gereken hesaplamaların daha hızlı yapılmasıydı. Türkiye’nin ilk bilgisayar destekli karayolu olan 63 km uzunluğundaki Polatlı - Sivrihisar yolu için yapılan hesaplamalar IBM 650 ile 1 saatte yapıldı. "
"Daha öncesinde 3 - 4 ayı bulan hesaplamaların 1 saate inmesi; teknolojinin, ekonomik ve toplumsal dönüşüme büyük etkide bulunacağının habercisiydi.")
doc = Doc(doc_str)
list(doc)
```
```python
['Bilişim sektörü, günlük devrimlerin yaşandığı ve hızına yetişilemeyen dev bir alan haline geleli uzun bir zaman olmadı.',
'Günümüz bilgisayarlarının tarihi, yarım asırı yeni tamamlarken; yaşanan gelişmeler çok daha büyük ölçekte.',
'Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu.',
'IBM 650 Model I adını taşıyan bilgisayarın satın alınma amacı ise yol yapımında gereken hesaplamaların daha hızlı yapılmasıydı.',
'Türkiye’nin ilk bilgisayar destekli karayolu olan 63 km uzunluğundaki Polatlı - Sivrihisar yolu için yapılan hesaplamalar IBM 650 ile 1 saatte yapıldı.',
'Daha öncesinde 3 - 4 ayı bulan hesaplamaların 1 saate inmesi; teknolojinin, ekonomik ve toplumsal dönüşüme büyük etkide bulunacağının habercisiydi.']
```
Access sentences by index.
```python
doc[2]
```
```python
Türkiye de bu gelişmelere 1960 yılında Karayolları Umum Müdürlüğü (şimdiki Karayolları Genel Müdürlüğü) için IBM’den satın aldığı ilk bilgisayarıyla dahil oldu.
```
## SadedeGel Server
In order to integrate with your applications we provide a quick summarizer server with sadedeGel.
```bash
python3 -m sadedegel.server
```
### SadedeGel Server on Heroku
[SadedeGel Server](https://sadedegel.herokuapp.com/api/info) is hosted on free tier of [Heroku](https://heroku.com) cloud services.
* [OpenAPI Documentation](https://sadedegel.herokuapp.com/docs)
* [Redoc Documentation](https://sadedegel.herokuapp.com/redoc)
* [Redirection to sadedegel.ai](https://sadedegel.herokuapp.com)
## PyLint, Flake8 and Bandit
sadedeGel utilized [pylint](https://www.pylint.org/) for static code analysis,
[flake8](https://flake8.pycqa.org/en/latest) for code styling and [bandit](https://pypi.org/project/bandit)
for code security check.
To run all tests
```bash
make lint
```
## Run tests
sadedeGel comes with an [extensive test suite](sadedegel/tests). In order to run the
tests, you'll usually want to clone the repository and build sadedeGel from source.
This will also install the required development dependencies and test utilities
defined in the `requirements.txt`.
Alternatively, you can find out where sadedeGel is installed and run `pytest` on
that directory. Don't forget to also install the test utilities via sadedeGel's
`requirements.txt`:
```bash
make test
```
## 📓 Kaggle
* Check [comprehensive notebook](https://www.kaggle.com/datafan07/clickbait-news-classification-using-sadedegel) of Kaggle Master [Ertugrul Demir](https://www.kaggle.com/datafan07) explaining the capabilities of sadedegel on Turkish clickbate dataset
## Youtube Channel
Some videos from [sadedeGel YouTube Channel](https://www.youtube.com/channel/UCyNG1Mehl44XWZ8LzkColuw)
### SkyLab YTU Webinar Playlist
[&style=social&withDislikes)](https://www.youtube.com/watch?v=xoEERspk6Is)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=HfWIzAwf5u8)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=PkUmYhahiMw)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=AxpK7fOndRQ)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=jKh_t9ZOJ-g)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=3DO1X7de1FI)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=KGg3DJQVH9c)
[&style=social&withDislikes)](https://www.youtube.com/watch?v=G_erifsGGFs)
## References
### Special Thanks
* [Starlang Software](https://starlangyazilim.com/) for their contribution to open source Turkish NLP development and corpus preperation.
* [Olcay Taner Yıldız, Ph.D.](https://github.com/olcaytaner), one of our refrees in [Açık Kaynak Hackathon Programı 2020](https://www.acikhack.com/), for helping our development on sadedegel.
* [Taner Sezer](https://github.com/tanerim) for his contribution on tokenization corpus and labeled news corpus.
### Our Community Contributors
We would like to thank our community contributors for their bug/enhancement requests and questions to make sadedeGel better everyday
* [Burak Işıklı](https://github.com/burakisikli)
### Software Engineering
* Special thanks to [spaCy](https://github.com/explosion/spaCy) project for their work in showing us the way to implement a proper python module rather than merely explaining it.
* We have borrowed many document and style related stuff from their code base :smile:
* There are a few free-tier service providers we need to thank:
* [GitHub](https://github.com) for
* Hosting our projects.
* Making it possible to collobrate easily.
* Automating our SLM via [Github Actions](https://github.com/features/actions)
* [Google Cloud Google Storage Service](https://cloud.google.com/products/storage) for providing low cost storage buckets making it possible to store `sadedegel.dataset.extended` data.
* [Heroku](https://heroku.com) for hosting [sadedeGel Server](https://sadedegel.herokuapp.com/api/info) in their free tier dynos.
* [CodeCov](https://codecov.io/) for allowing us to transparently share our [test coverage](https://codecov.io/gh/globalmaksimum/sadedegel)
* [PyPI](https://pypi.org/) for allowing us to share [sadedegel](https://pypi.org/project/sadedegel) with you.
* [binder](https://mybinder.org/) for
* Allowing us to share our example [notebooks](notebook/)
* Hosting our learn by example boxes in [sadedegel.ai](http://sadedegel.ai)
### Machine Learning (ML), Deep Learning (DL) and Natural Language Processing (NLP)
* Resources on Extractive Text Summarization:
* [Leveraging BERT for Extractive Text Summarization on Lectures](https://arxiv.org/abs/1906.04165) by Derek Miller
* [Fine-tune BERT for Extractive Summarization](https://arxiv.org/pdf/1903.10318.pdf) by Yang Liu
* Other NLP related references
* [ROUGE: A Package for Automatic Evaluation of Summaries](https://www.aclweb.org/anthology/W04-1013.pdf)
* [Speech and Language Processing, Second Edition](https://web.stanford.edu/~jurafsky/slp3/)
%prep
%autosetup -n sadedegel-0.21.2
%build
%py3_build
%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
find usr/lib -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
find usr/lib64 -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
find usr/bin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
find usr/sbin -type f -printf "\"/%h/%f\"\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
find usr/share/man -type f -printf "\"/%h/%f.gz\"\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .
%files -n python3-sadedegel -f filelist.lst
%dir %{python3_sitelib}/*
%files help -f doclist.lst
%{_docdir}/*
%changelog
* Fri Jun 09 2023 Python_Bot <Python_Bot@openeuler.org> - 0.21.2-1
- Package Spec generated
|