Select Language

Open Dataset

ウィキペディアWord2Vec、Apache Spark word2vecは20万件のウィキペディアページでトレーニングされました

ウィキペディアWord2Vec、Apache Spark word2vecは20万件のウィキペディアページでトレーニングされました

132.74M
392 hits
0 likes
0 downloads
0 discuss
NLP,Business,Earth and Nature,Text Mining Classification

私はApache Sparkを使って、20万件の英語版ウィキペディアページから600万以上のフレーズを抽出しました。以下は…のプロセスです。......

Data Structure ? 132.74M

    Data Structure ?

    *The above analysis is the result extracted and analyzed by the system, and the specific actual data shall prevail.

    README.md

    私はApache Sparkを使って、20万件の英語版Wikipediaページから600万以上のフレーズを抽出しました。以下は、クリーニング、キーワード抽出、およびWord2Vecモデルのトレーニングのプロセスです:

    1. ページのタイトルと本文を結合する

    2. 文の検出 (spark-nlp)

    3. トークナイザー (spark-nlp)

    4. 正規化器 (spark-nlp) 品詞タガー (spark-nlp) 文法規則によるチャンキングで、ユニグラムとマルチグラムの両方を検出する (spark-nlp)

    5. ストップワードの削除 (Spark ML)

    6. Word2Vecモデルのトレーニングと変換 (Spark ML)

    内容

    Word2Vecモデルの詳細:

    val word2Vec = new Word2Vec()
      .setInputCol("filteredPhrases")
      .setOutputCol("word2vec")
      .setVectorSize(300)
      .setMinCount(10)
      .setMaxIter(1)
      .setNumPartitions(1)

    使い方

    このモデルをダウンロードして、Apache Spark MLパイプラインにロードすることができます:

    import org.apache.spark.ml._
    
    val pipeLineWord2VecModel = PipelineModel.read.load("/tmp/multivac_nlp_ml_200k")
    val word2VecModel = pipeLineWord2VecModel.stages.last.asInstanceOf[Word2VecModel]
    
    word2VecModel.findSynonyms("climate change", 10).show(false)
    +--------------------------+------------------+
    |word                      |similarity        |
    +--------------------------+------------------+
    |global warming            |0.7534363269805908|
    |intergovernmental panel   |0.7303586602210999|
    |sustainable development   |0.714561939239502 |
    |greenhouse gas emissions  |0.6958430409431458|
    |food security             |0.6919037103652954|
    |development policy        |0.6879498958587646|
    |environmental policy      |0.6868311166763306|
    |energy security           |0.681218147277832 |
    |multinational corporations|0.6769515872001648|
    |tax policy                |0.671006977558136 |
    +--------------------------+------------------+
    
    word2VecModel.findSynonyms("football", 10).show(false)
    +--------------------------+------------------+
    |word                      |similarity        |
    +--------------------------+------------------+
    |football team             |0.7648624181747437|
    |football soccer           |0.7647290229797363|
    |field hockey              |0.745803952217102 |
    |football teams            |0.7442964911460876|
    |soccer                    |0.7377723455429077|
    |professional football     |0.7375280261039734|
    |youth academy             |0.7372391819953918|
    |national basketball league|0.7333077788352966|
    |coach                     |0.7324917912483215|
    |league championships      |0.7308306694030762|
    +--------------------------+------------------+
    
    word2VecModel.findSynonyms("cancer", 10).show(false)
    +-----------------------+------------------+
    |word                   |similarity        |
    +-----------------------+------------------+
    |climate change         |0.7534365057945251|
    |literature review      |0.7533518075942993|
    |minimize               |0.7510043382644653|
    |categorization         |0.7404615879058838|
    |health effects         |0.7371178269386292|
    |genetic information    |0.7362238168716431|
    |scientific basis       |0.7347298860549927|
    |intergovernmental panel|0.734147846698761 |
    |recent study           |0.7333264350891113|
    |food security          |0.7322153449058533|
    +-----------------------+------------------+
    
    +----------------------+------------------+
    
    word2VecModel.findSynonyms("london", 10).show(false)
    |word                  |similarity        |
    +----------------------+------------------+
    |edinburgh             |0.6135260462760925|
    |glasgow               |0.5734920501708984|
    |bristol               |0.5710445642471313|
    |edinburgh scotland    |0.5306239724159241|
    |kensington            |0.5289728045463562|
    |islington             |0.5218709707260132|
    |clapham               |0.5164309144020081|
    |leicester             |0.5161707401275635|
    |cambridge             |0.5141464471817017|
    |royal scottish academy|0.508998453617096 |
    +----------------------+------------------+

    環境

    謝辞

    この作業は、ISC-PIF/CNRS(UPS3611)Multivacプラットフォームのインフラストラクチャを使用して行われました。


    ×

    The dataset is currently being organized and other channels have been prepared for you. Please use them

    The dataset is currently being organized and other channels have been prepared for you. Please use them

    Note: Some data is currently being processed and cannot be directly downloaded. We kindly ask for your understanding and support.
    No content available at the moment
    No content available at the moment
    • Share your thoughts
    Go share your ideas~~

    ALL

      Welcome to exchange and share
      Your sharing can help others better utilize data.
    Points:25 Go earn points?
    • 392
    • 0
    • 0
    • collect
    • Share