Underthesea est:
? Une boîte à outils Vietnamienne NLP. Underhesea est une suite d'ensembles de données et de tutoriels de modules Python open source soutenant la recherche et le développement dans le traitement du langage naturel vietnamien. Nous fournissons une API extrêmement facile à appliquer rapidement des modèles NLP pré-étendus à votre texte vietnamien, tels que la segmentation des mots, le marquage de la parole (POS), la reconnaissance d'entité nommée (NER), la classification du texte et l'analyse de dépendance.
? Un logiciel open source. Underhesea est publiée sous la licence GNU General Public Licence V3.0. Les autorisations de cette forte licence Copyleft sont conditionnées à la mise à disposition du code source complet des travaux et des modifications sous licence, qui incluent des travaux plus importants à l'aide d'un travail sous licence, sous la même licence.
? Soutenez-nous! Chaque soutien nous aide à atteindre nos objectifs. Merci beaucoup. ???
? Salut! Avez-vous entendu parler de LLMS , les modèles basés sur l'invite ? Eh bien, devinez quoi? À partir de la version 6.7.0 de Underhesea, vous pouvez désormais plonger en profondeur avec cette fonctionnalité super cool pour la classification du texte! Plongez-vous et faites des éclaboussures! ?
Pour installer Underhesea, simplement:
$ pip install underthesea
?Satisfaction, garantie.
Usage
> >> from underthesea import sent_tokenize
> >> text = 'Taylor cho biết lúc đầu cô cảm thấy ngại với cô bạn thân Amanda nhưng rồi mọi thứ trôi qua nhanh chóng. Amanda cũng thoải mái với mối quan hệ này.'
> >> sent_tokenize ( text )
[
"Taylor cho biết lúc đầu cô cảm thấy ngại với cô bạn thân Amanda nhưng rồi mọi thứ trôi qua nhanh chóng." ,
"Amanda cũng thoải mái với mối quan hệ này."
]Usage
> >> from underthesea import text_normalize
> >> text_normalize ( "Ðảm baỏ chất lựơng phòng thí nghịêm hoá học" )
"Đảm bảo chất lượng phòng thí nghiệm hóa học"Usage
> >> from underthesea import word_tokenize
> >> text = "Chàng trai 9X Quảng Trị khởi nghiệp từ nấm sò"
> >> word_tokenize ( text )
[ "Chàng trai" , "9X" , "Quảng Trị" , "khởi nghiệp" , "từ" , "nấm" , "sò" ]
> >> word_tokenize ( sentence , format = "text" )
"Chàng_trai 9X Quảng_Trị khởi_nghiệp từ nấm sò"
> >> text = "Viện Nghiên Cứu chiến lược quốc gia về học máy"
> >> fixed_words = [ "Viện Nghiên Cứu" , "học máy" ]
> >> word_tokenize ( text , fixed_words = fixed_words )
"Viện_Nghiên_Cứu chiến_lược quốc_gia về học_máy"Usage
> >> from underthesea import pos_tag
> >> pos_tag ( 'Chợ thịt chó nổi tiếng ở Sài Gòn bị truy quét' )
[( 'Chợ' , 'N' ),
( 'thịt' , 'N' ),
( 'chó' , 'N' ),
( 'nổi tiếng' , 'A' ),
( 'ở' , 'E' ),
( 'Sài Gòn' , 'Np' ),
( 'bị' , 'V' ),
( 'truy quét' , 'V' )]Usage
> >> from underthesea import chunk
> >> text = 'Bác sĩ bây giờ có thể thản nhiên báo tin bệnh nhân bị ung thư?'
> >> chunk ( text )
[( 'Bác sĩ' , 'N' , 'B-NP' ),
( 'bây giờ' , 'P' , 'B-NP' ),
( 'có thể' , 'R' , 'O' ),
( 'thản nhiên' , 'A' , 'B-AP' ),
( 'báo' , 'V' , 'B-VP' ),
( 'tin' , 'N' , 'B-NP' ),
( 'bệnh nhân' , 'N' , 'B-NP' ),
( 'bị' , 'V' , 'B-VP' ),
( 'ung thư' , 'N' , 'B-NP' ),
( '?' , 'CH' , 'O' )]⚛️⚛️ Modèle d'apprentissage en profondeur
$ pip install underthesea[deep] > >> from underthesea import dependency_parse
> >> text = 'Tối 29/11, Việt Nam thêm 2 ca mắc Covid-19'
> >> dependency_parse ( text )
[( 'Tối' , 5 , 'obl:tmod' ),
( '29/11' , 1 , 'flat:date' ),
( ',' , 1 , 'punct' ),
( 'Việt Nam' , 5 , 'nsubj' ),
( 'thêm' , 0 , 'root' ),
( '2' , 7 , 'nummod' ),
( 'ca' , 5 , 'obj' ),
( 'mắc' , 7 , 'nmod' ),
( 'Covid-19' , 8 , 'nummod' )] ⚛️Usage
> >> from underthesea import ner
> >> text = 'Chưa tiết lộ lịch trình tới Việt Nam của Tổng thống Mỹ Donald Trump'
> >> ner ( text )
[( 'Chưa' , 'R' , 'O' , 'O' ),
( 'tiết lộ' , 'V' , 'B-VP' , 'O' ),
( 'lịch trình' , 'V' , 'B-VP' , 'O' ),
( 'tới' , 'E' , 'B-PP' , 'O' ),
( 'Việt Nam' , 'Np' , 'B-NP' , 'B-LOC' ),
( 'của' , 'E' , 'B-PP' , 'O' ),
( 'Tổng thống' , 'N' , 'B-NP' , 'O' ),
( 'Mỹ' , 'Np' , 'B-NP' , 'B-LOC' ),
( 'Donald' , 'Np' , 'B-NP' , 'B-PER' ),
( 'Trump' , 'Np' , 'B-NP' , 'I-PER' )]⚛️ Modèle d'apprentissage en profondeur
$ pip install underthesea[deep] > >> from underthesea import ner
> >> text = "Bộ Công Thương xóa một tổng cục, giảm nhiều đầu mối"
> >> ner ( text , deep = True )
[
{ 'entity' : 'B-ORG' , 'word' : 'Bộ' },
{ 'entity' : 'I-ORG' , 'word' : 'Công' },
{ 'entity' : 'I-ORG' , 'word' : 'Thương' }
] ⚡Usage
> >> from underthesea import classify
> >> classify ( 'HLV đầu tiên ở Premier League bị sa thải sau 4 vòng đấu' )
[ 'The thao' ]
> >> classify ( 'Hội đồng tư vấn kinh doanh Asean vinh danh giải thưởng quốc tế' )
[ 'Kinh doanh' ]
>> classify ( 'Lãi suất từ BIDV rất ưu đãi' , domain = 'bank' )
[ 'INTEREST_RATE' ]⚡ Modèle basé sur l'invite
$ pip install underthesea[prompt]
$ export OPENAI_API_KEY=YOUR_KEY > >> from underthesea import classify
> >> text = "HLV ngoại đòi gần tỷ mỗi tháng dẫn dắt tuyển Việt Nam"
> >> classify ( text , model = 'prompt' )
Thể thaoUsage
> >> from underthesea import sentiment
> >> sentiment ( 'hàng kém chất lg,chăn đắp lên dính lông lá khắp người. thất vọng' )
'negative'
> >> sentiment ( 'Sản phẩm hơi nhỏ so với tưởng tượng nhưng chất lượng tốt, đóng gói cẩn thận.' )
'positive'
> >> sentiment ( 'Đky qua đường link ở bài viết này từ thứ 6 mà giờ chưa thấy ai lhe hết' , domain = 'bank' )
[ 'CUSTOMER_SUPPORT#negative' ]
> >> sentiment ( 'Xem lại vẫn thấy xúc động và tự hào về BIDV của mình' , domain = 'bank' )
[ 'TRADEMARK#positive' ]⚛️Lang détecte l'API. Merci à un travail génial de FastText
Installez les dépendances et les modèles
```bash
$ pip install underthesea[langdetect]
```
Exemples d'utilisation dans le script
```python
>>> from underthesea import lang_detect
>>> lang_detect("Cựu binh Mỹ trả nhật ký nhẹ lòng khi thấy cuộc sống hòa bình tại Việt Nam")
vi
```
⚛️API texte à la parole. Merci à un travail génial de NTT123 / Vietts
Installez les dépendances et les modèles
```bash
$ pip install underthesea[wow]
$ underthesea download-model VIET_TTS_V0_4_1
```
Exemples d'utilisation dans le script
```python
>>> from underthesea.pipeline.say import say
>>> say("Cựu binh Mỹ trả nhật ký nhẹ lòng khi thấy cuộc sống hòa bình tại Việt Nam")
A new audio file named `sound.wav` will be generated.
```
Exemples d'utilisation en ligne de commande
```sh
$ underthesea say "Cựu binh Mỹ trả nhật ký nhẹ lòng khi thấy cuộc sống hòa bình tại Việt Nam"
```
Répertorier les ressources
$ underthesea list-data
| Name | Type | License | Year | Directory |
| ---------------------------+-------------+---------+------+------------------------------------ |
| CP_Vietnamese_VLC_v2_2022 | Plaintext | Open | 2023 | datasets/CP_Vietnamese_VLC_v2_2022 |
| UIT_ABSA_RESTAURANT | Sentiment | Open | 2021 | datasets/UIT_ABSA_RESTAURANT |
| UIT_ABSA_HOTEL | Sentiment | Open | 2021 | datasets/UIT_ABSA_HOTEL |
| SE_Vietnamese-UBS | Sentiment | Open | 2020 | datasets/SE_Vietnamese-UBS |
| CP_Vietnamese-UNC | Plaintext | Open | 2020 | datasets/CP_Vietnamese-UNC |
| DI_Vietnamese-UVD | Dictionary | Open | 2020 | datasets/DI_Vietnamese-UVD |
| UTS2017-BANK | Categorized | Open | 2017 | datasets/UTS2017-BANK |
| VNTQ_SMALL | Plaintext | Open | 2012 | datasets/LTA |
| VNTQ_BIG | Plaintext | Open | 2012 | datasets/LTA |
| VNESES | Plaintext | Open | 2012 | datasets/LTA |
| VNTC | Categorized | Open | 2007 | datasets/VNTC |
$ underthesea list-data --allTélécharger des ressources
$ underthesea download-data CP_Vietnamese_VLC_v2_2022
Resource CP_Vietnamese_VLC_v2_2022 is downloaded in ~ /.underthesea/datasets/CP_Vietnamese_VLC_v2_2022 folderVoulez-vous contribuer au développement de sous-étages? Super! Veuillez lire plus de détails sur Contribution.RST
Si vous trouviez ce projet utile et que vous souhaitez soutenir notre travail, vous pouvez simplement nous acheter un café ☕.
Votre soutien est notre plus grand encouragement ?!