SHARE
TWEET

Untitled

a guest Dec 16th, 2019 97 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (.venv_py3) pegasus@pegasus-v2-backend-3:~/app/entity-v2$ python
  2. Python 3.7.5 (default, Dec 16 2019, 13:06:40)
  3. [GCC 5.4.0 20160609] on linux
  4. Type "help", "copyright", "credits" or "license" for more information.
  5. >>> import stanfordnlp
  6. >>> nlp = stanfordnlp.Pipeline(lang='id')
  7. Use device: cpu
  8. ---
  9. Loading: tokenize
  10. With settings:
  11. {'model_path': '/home/pegasus/stanfordnlp_resources/id_gsd_models/id_gsd_tokenizer.pt', 'lang': 'id', 'shorthand': 'id_gsd', 'mode': 'predict'}
  12. ---
  13. Loading: pos
  14. With settings:
  15. {'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'}
  16. ---
  17. Loading: lemma
  18. With settings:
  19. {'model_path': '/home/pegasus/stanfordnlp_resources/id_gsd_models/id_gsd_lemmatizer.pt', 'lang': 'id', 'shorthand': 'id_gsd', 'mode': 'predict'}
  20. Building an attentional Seq2Seq model...
  21. Using a Bi-LSTM encoder
  22. Using soft attention for LSTM.
  23. Finetune all embeddings.
  24. [Running seq2seq lemmatizer with edit classifier]
  25. ---
  26. Loading: depparse
  27. With settings:
  28. {'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'}
  29. Done loading processors!
  30. ---
  31. >>> text = """
  32. ... 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.
  33. ... """
  34. >>> doc = nlp(text)
  35. /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.
  36. >>> print(*[f'word: {word.text+" "}\tupos: {word.upos}\txpos: {word.xpos}' for sent in doc.sentences for word in sent.words], sep='\n')
  37. word: Rencana   upos: PROPN xpos: NSD
  38. word: pembangunan   upos: NOUN  xpos: NSD
  39. word: pembangkit    upos: NOUN  xpos: NSD
  40. word: megaproyek    upos: NOUN  xpos: X--
  41. word: 35    upos: NUM   xpos: CC-
  42. word: ribu  upos: NOUN  xpos: CC-
  43. word: megawatt  upos: NOUN  xpos: NSD
  44. word: masih     upos: ADV   xpos: D--
  45. word: terkendala    upos: VERB  xpos: VSP
  46. word: oleh  upos: ADP   xpos: R--
  47. word: permasalahan  upos: NOUN  xpos: NSD
  48. word: pembangunan   upos: NOUN  xpos: NSD
  49. word: transmisi     upos: NOUN  xpos: NSD
  50. word: listrik   upos: NOUN  xpos: NSD
  51. word: .     upos: PUNCT xpos: Z--
  52. word: Hal   upos: NOUN  xpos: NSD
  53. word: tersebut  upos: DET   xpos: B--
  54. word: sempat    upos: ADV   xpos: D--
  55. word: diungkapkan   upos: VERB  xpos: VSP
  56. word: oleh  upos: ADP   xpos: R--
  57. word: Pelaksana     upos: PROPN xpos: NSD
  58. word: Tugas     upos: PROPN xpos: NSD
  59. word: (     upos: PUNCT xpos: Z--
  60. word: Plt   upos: PROPN xpos: X--
  61. word: )     upos: PUNCT xpos: Z--
  62. word: Direktur  upos: PROPN xpos: NSD
  63. word: Utama     upos: PROPN xpos: ASP
  64. word: PLN   upos: PROPN xpos: F--
  65. word: Sripeni   upos: PROPN xpos: X--
  66. word: Inten     upos: PROPN xpos: X--
  67. word: Cahyani   upos: PROPN xpos: X--
  68. word: kepada    upos: ADP   xpos: R--
  69. word: anggota   upos: NOUN  xpos: NSD
  70. word: Dewan     upos: PROPN xpos: NSD
  71. word: Perwakilan    upos: PROPN xpos: NSD
  72. word: Rakyat    upos: PROPN xpos: NSD
  73. word: (     upos: PUNCT xpos: Z--
  74. word: DPR   upos: PROPN xpos: X--
  75. word: )     upos: PUNCT xpos: Z--
  76. word: .     upos: PUNCT xpos: Z--
  77. word: Saat  upos: SCONJ xpos: NSD
  78. word: dikonfirmasi  upos: VERB  xpos: VSP
  79. word: ,     upos: PUNCT xpos: Z--
  80. word: Vice  upos: PROPN xpos: F--
  81. word: Presiden  upos: PROPN xpos: NSD
  82. word: Public    upos: PROPN xpos: F--
  83. word: Relation  upos: PROPN xpos: F--
  84. word: PLN   upos: PROPN xpos: F--
  85. word: Dwi   upos: PROPN xpos: F--
  86. word: Suryo     upos: PROPN xpos: F--
  87. word: Abdullah  upos: PROPN xpos: F--
  88. word: menuturkan    upos: VERB  xpos: VSA
  89. word: kendala   upos: NOUN  xpos: NSD
  90. word: dalam     upos: ADP   xpos: ASP
  91. word: pembangunan   upos: NOUN  xpos: NSD
  92. word: transmisi     upos: NOUN  xpos: NSD
  93. word: ini   upos: DET   xpos: B--
  94. word: terjadi   upos: VERB  xpos: VSP
  95. word: lantaran  upos: SCONJ xpos: S--
  96. word: masih     upos: ADV   xpos: D--
  97. word: ada   upos: VERB  xpos: ASP
  98. word: sebagian  upos: DET   xpos: ASP
  99. word: lahan     upos: NOUN  xpos: NSD
  100. word: yang  upos: PRON  xpos: S--
  101. word: belum     upos: ADV   xpos: G--
  102. word: bisa  upos: ADV   xpos: M--
  103. word: bebas     upos: ADJ   xpos: ASP
  104. word: sesuai    upos: ADP   xpos: ASP
  105. word: target    upos: NOUN  xpos: NSD
  106. word: waktu     upos: NOUN  xpos: NSD
  107. word: .     upos: PUNCT xpos: Z--
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top