<kbd id="afajh"><form id="afajh"></form></kbd>
<strong id="afajh"><dl id="afajh"></dl></strong>
    <del id="afajh"><form id="afajh"></form></del>
        1. <th id="afajh"><progress id="afajh"></progress></th>
          <b id="afajh"><abbr id="afajh"></abbr></b>
          <th id="afajh"><progress id="afajh"></progress></th>

          Stanza斯坦福自然語(yǔ)言處理 Python 庫(kù)

          聯(lián)合創(chuàng)作 · 2023-09-25 21:40

          Stanza 是斯坦福 NLP 組的官方 Python NLP(自然語(yǔ)言處理) 庫(kù)。它支持在 60 多種語(yǔ)言上運(yùn)行各種準(zhǔn)確的自然語(yǔ)言處理工具,并支持從 Python 訪問 Java Stanford CoreNLP 軟

          安裝

          pip

          Stanza 支持 Python 3.6 或更高版本。建議通過(guò) Python 包管理器 pip 安裝 Stanza 

          pip install stanza
          

          如果當(dāng)前安裝了以前的版本stanza,請(qǐng)使用:

          pip install stanza -U
          

          Anaconda

          要通過(guò) Anaconda 安裝 Stanza,請(qǐng)使用以下 conda 命令:

          conda install -c stanfordnlp stanza
          

          請(qǐng)注意,目前已通過(guò) Anaconda 安裝 Stanza 不適用于 Python 3.8。對(duì)于 Python 3.8,請(qǐng)使用 pip 安裝。

          從源代碼

          也可以從這個(gè) git 倉(cāng)庫(kù)的源代碼安裝:

          git clone https://github.com/stanfordnlp/stanza.git
          cd stanza
          pip install -e .
          

          運(yùn)行 Stanza

          要運(yùn)行您的第一個(gè) Stanza 管道,只需在您的 Python 交互式解釋器中執(zhí)行以下步驟:

          >>> import stanza
          >>> stanza.download('en')       # This downloads the English models for the neural pipeline
          >>> nlp = stanza.Pipeline('en') # This sets up a default neural pipeline in English
          >>> doc = nlp("Barack Obama was born in Hawaii.  He was elected president in 2008.")
          >>> doc.sentences[0].print_dependencies()
          

          如果遇到requests.exceptions.ConnectionError,請(qǐng)嘗試使用代理:

          >>> import stanza
          >>> proxies = {'http': 'http://ip:port', 'https': 'http://ip:port'}
          >>> stanza.download('en', proxies=proxies)  # This downloads the English models for the neural pipeline
          >>> nlp = stanza.Pipeline('en')             # This sets up a default neural pipeline in English
          >>> doc = nlp("Barack Obama was born in Hawaii.  He was elected president in 2008.")
          >>> doc.sentences[0].print_dependencies()
          
          瀏覽 32
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          評(píng)論
          圖片
          表情
          推薦
          點(diǎn)贊
          評(píng)論
          收藏
          分享

          手機(jī)掃一掃分享

          編輯 分享
          舉報(bào)
          <kbd id="afajh"><form id="afajh"></form></kbd>
          <strong id="afajh"><dl id="afajh"></dl></strong>
            <del id="afajh"><form id="afajh"></form></del>
                1. <th id="afajh"><progress id="afajh"></progress></th>
                  <b id="afajh"><abbr id="afajh"></abbr></b>
                  <th id="afajh"><progress id="afajh"></progress></th>
                  AAAAAA免费视频 | 欧美双飞在线 | 欧美18禁黄免费网站 | 亚洲日韩欧美丝袜制服在线播放 | 欧美精品|