Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (.venv_py3) pegasus@pegasus-v2-backend-3:~/app/entity-v2$ python
- Python 3.7.5 (default, Dec 16 2019, 13:06:40)
- [GCC 5.4.0 20160609] on linux
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import stanfordnlp
- >>> nlp = stanfordnlp.Pipeline(lang='id')
- Use device: cpu
- ---
- Loading: tokenize
- With settings:
- {'model_path': '/home/pegasus/stanfordnlp_resources/id_gsd_models/id_gsd_tokenizer.pt', 'lang': 'id', 'shorthand': 'id_gsd', 'mode': 'predict'}
- ---
- Loading: pos
- With settings:
- {'model_path': '/home/pegasus/stanfordnlp_resources/id_gsd_models/id_gsd_tagger.pt', 'pretrain_path': '/home/pegasus/stanfordnlp_resources/id_gsd_models/id_gsd.pretrain.pt', 'lang': 'id', 'shorthand': 'id_gsd', 'mode': 'predict'}
- ---
- Loading: lemma
- With settings:
- {'model_path': '/home/pegasus/stanfordnlp_resources/id_gsd_models/id_gsd_lemmatizer.pt', 'lang': 'id', 'shorthand': 'id_gsd', 'mode': 'predict'}
- Building an attentional Seq2Seq model...
- Using a Bi-LSTM encoder
- Using soft attention for LSTM.
- Finetune all embeddings.
- [Running seq2seq lemmatizer with edit classifier]
- ---
- Loading: depparse
- With settings:
- {'model_path': '/home/pegasus/stanfordnlp_resources/id_gsd_models/id_gsd_parser.pt', 'pretrain_path': '/home/pegasus/stanfordnlp_resources/id_gsd_models/id_gsd.pretrain.pt', 'lang': 'id', 'shorthand': 'id_gsd', 'mode': 'predict'}
- Done loading processors!
- ---
- >>> text = """
- ... Rencana pembangunan pembangkit megaproyek 35 ribu megawatt masih terkendala oleh permasalahan pembangunan transmisi listrik. Hal tersebut sempat diungkapkan oleh Pelaksana Tugas (Plt) Direktur Utama PLN Sripeni Inten Cahyani kepada anggota Dewan Perwakilan Rakyat (DPR). Saat dikonfirmasi, Vice Presiden Public Relation PLN Dwi Suryo Abdullah menuturkan kendala dalam pembangunan transmisi ini terjadi lantaran masih ada sebagian lahan yang belum bisa bebas sesuai target waktu.
- ... """
- >>> doc = nlp(text)
- /pytorch/aten/src/ATen/native/LegacyDefinitions.cpp:19: UserWarning: masked_fill_ received a mask with dtype torch.uint8, this behavior is now deprecated,please use a mask with dtype torch.bool instead.
- >>> print(*[f'word: {word.text+" "}\tupos: {word.upos}\txpos: {word.xpos}' for sent in doc.sentences for word in sent.words], sep='\n')
- word: Rencana upos: PROPN xpos: NSD
- word: pembangunan upos: NOUN xpos: NSD
- word: pembangkit upos: NOUN xpos: NSD
- word: megaproyek upos: NOUN xpos: X--
- word: 35 upos: NUM xpos: CC-
- word: ribu upos: NOUN xpos: CC-
- word: megawatt upos: NOUN xpos: NSD
- word: masih upos: ADV xpos: D--
- word: terkendala upos: VERB xpos: VSP
- word: oleh upos: ADP xpos: R--
- word: permasalahan upos: NOUN xpos: NSD
- word: pembangunan upos: NOUN xpos: NSD
- word: transmisi upos: NOUN xpos: NSD
- word: listrik upos: NOUN xpos: NSD
- word: . upos: PUNCT xpos: Z--
- word: Hal upos: NOUN xpos: NSD
- word: tersebut upos: DET xpos: B--
- word: sempat upos: ADV xpos: D--
- word: diungkapkan upos: VERB xpos: VSP
- word: oleh upos: ADP xpos: R--
- word: Pelaksana upos: PROPN xpos: NSD
- word: Tugas upos: PROPN xpos: NSD
- word: ( upos: PUNCT xpos: Z--
- word: Plt upos: PROPN xpos: X--
- word: ) upos: PUNCT xpos: Z--
- word: Direktur upos: PROPN xpos: NSD
- word: Utama upos: PROPN xpos: ASP
- word: PLN upos: PROPN xpos: F--
- word: Sripeni upos: PROPN xpos: X--
- word: Inten upos: PROPN xpos: X--
- word: Cahyani upos: PROPN xpos: X--
- word: kepada upos: ADP xpos: R--
- word: anggota upos: NOUN xpos: NSD
- word: Dewan upos: PROPN xpos: NSD
- word: Perwakilan upos: PROPN xpos: NSD
- word: Rakyat upos: PROPN xpos: NSD
- word: ( upos: PUNCT xpos: Z--
- word: DPR upos: PROPN xpos: X--
- word: ) upos: PUNCT xpos: Z--
- word: . upos: PUNCT xpos: Z--
- word: Saat upos: SCONJ xpos: NSD
- word: dikonfirmasi upos: VERB xpos: VSP
- word: , upos: PUNCT xpos: Z--
- word: Vice upos: PROPN xpos: F--
- word: Presiden upos: PROPN xpos: NSD
- word: Public upos: PROPN xpos: F--
- word: Relation upos: PROPN xpos: F--
- word: PLN upos: PROPN xpos: F--
- word: Dwi upos: PROPN xpos: F--
- word: Suryo upos: PROPN xpos: F--
- word: Abdullah upos: PROPN xpos: F--
- word: menuturkan upos: VERB xpos: VSA
- word: kendala upos: NOUN xpos: NSD
- word: dalam upos: ADP xpos: ASP
- word: pembangunan upos: NOUN xpos: NSD
- word: transmisi upos: NOUN xpos: NSD
- word: ini upos: DET xpos: B--
- word: terjadi upos: VERB xpos: VSP
- word: lantaran upos: SCONJ xpos: S--
- word: masih upos: ADV xpos: D--
- word: ada upos: VERB xpos: ASP
- word: sebagian upos: DET xpos: ASP
- word: lahan upos: NOUN xpos: NSD
- word: yang upos: PRON xpos: S--
- word: belum upos: ADV xpos: G--
- word: bisa upos: ADV xpos: M--
- word: bebas upos: ADJ xpos: ASP
- word: sesuai upos: ADP xpos: ASP
- word: target upos: NOUN xpos: NSD
- word: waktu upos: NOUN xpos: NSD
- word: . upos: PUNCT xpos: Z--
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement