Google ColabでfastTextモデルの読み込み (2021/07/04)

```
!git clone https://github.com/facebookresearch/fastText.git
%cd fastText
!pip install .
%cd ..
```


```
import fasttext

!wget https://dl.fbaipublicfiles.com/fasttext/vectors-crawl/cc.ja.300.bin.gz
!gunzip cc.ja.300.bin.gz
model = fasttext.load_model('/content/cc.ja.300.bin')
```


```
model['日本']
#実行結果
array([ 1.84371859e-01,  1.30560966e-02,  5.10063887e-01,  7.69418105e-02,
        9.64416750e-03,  9.04284865e-02,  2.04270765e-01, -1.85921825e-02,
       -2.22112425e-02,  3.74919809e-02,  1.07251115e-01, -1.15759447e-01,
       -1.02375761e-01,  1.96929261e-01, -2.22842708e-01,  9.24901143e-02,
        5.70714846e-02,  5.84519394e-02, -6.67003691e-02,  1.78672969e-01,
        3.80060524e-02,  1.27196178e-01, -1.51944131e-01,  8.14709291e-02,
       -3.94884823e-03, -7.49160768e-03,  2.09851146e-01, -1.93977445e-01,
       -1.97427258e-01,  2.60839224e-01, -9.04929638e-02, -6.37207031e-02,
       -1.07364513e-01,  8.87959674e-02,  2.30117086e-02, -1.05221957e-01,
        2.20456459e-02, -6.22993186e-02,  6.23101331e-02, -1.27318040e-01,
        4.66003306e-02, -2.31770519e-03,  6.78381622e-02,  8.11960995e-02,
       -1.18628502e-01, -6.79320171e-02, -1.22130081e-01,  3.74780595e-02,
        2.64606904e-02, -5.82636055e-03,  2.89726239e-02, -1.03919670e-01,
       -1.50140123e-02,  6.67628944e-02, -3.66069824e-02,  3.68277937e-01,
        5.54680526e-02,  2.15622038e-01,  8.14047530e-02,  5.81292100e-02,
        5.86307310e-02,  1.42769804e-02, -3.37049998e-02, -7.93622285e-02,
       -5.46595715e-02, -1.02000304e-01,  1.73306540e-01,  2.20326725e-02,
       -1.87119603e-01,  2.69544929e-01, -7.28202518e-03, -7.45107681e-02,
        2.56447122e-02,  2.07773652e-02,  1.05649367e-01, -9.41904783e-02,
        9.32117999e-02,  8.48960355e-02,  2.74537434e-03, -1.09418131e-01,
       -2.30311584e-02,  8.65772441e-02, -1.66294917e-01,  9.23115239e-02,
        1.17588453e-01,  1.19479097e-01, -1.27334744e-01,  1.23038031e-02,
        9.14057642e-02,  2.57868737e-01,  7.12213367e-02, -1.46850780e-01,
       -1.34123191e-01,  1.55969739e-01, -1.44229624e-02, -1.00200176e-01,
       -4.59572345e-01,  8.47368464e-02,  3.98487635e-02, -2.36992255e-01,
       -1.01982825e-01,  1.36554852e-01, -5.84617332e-02, -1.09598108e-01,
        2.11817678e-03,  6.39091551e-01, -2.60233313e-01, -2.40845978e-02,
       -8.50505307e-02,  1.68922618e-01,  1.71109047e-02,  3.35228413e-01,
       -3.97788696e-02,  1.78045426e-02,  5.74341901e-02,  6.38390630e-02,
       -1.77783459e-01, -5.89239635e-02,  1.01663046e-01, -1.81211337e-01,
        4.38550152e-02, -9.18857753e-02,  2.72189341e-02,  1.04000874e-01,
        4.35036570e-02, -1.35352612e-01,  1.22414045e-01,  2.60868482e-02,
        1.85788885e-01, -3.79207939e-01, -1.21191874e-01,  1.08935334e-01,
        2.40191653e-01, -7.19789490e-02, -1.59166172e-01, -6.26588821e-01,
       -2.01273426e-01, -1.23372301e-01,  4.39514443e-02,  5.00102714e-02,
        2.82720663e-02, -1.91064119e-01, -1.76345184e-01, -1.06385887e-01,
        1.06628962e-01, -9.25679877e-02,  1.13727659e-01,  3.86918873e-01,
        2.39350915e-01,  1.60897732e-01,  7.56312162e-02, -3.99690717e-02,
       -7.46844783e-02,  8.76162872e-02,  1.91491395e-01, -2.76356693e-02,
       -1.36159435e-01, -1.65947899e-01, -1.05876900e-01,  8.89221430e-02,
       -1.82034016e-01,  1.12271942e-02,  7.59037286e-02,  3.98885339e-01,
       -4.42311168e-02, -1.18877128e-01, -7.23301023e-02,  6.13053665e-02,
       -2.19897017e-01, -9.27520543e-02, -1.53240547e-01, -8.77119228e-02,
       -8.11242536e-02,  8.59985277e-02, -9.07143131e-02,  3.87684023e-03,
        9.09307450e-02, -2.06960142e-02, -7.55135790e-02,  8.56240653e-03,
        6.65401444e-02,  5.39328577e-03, -1.84449717e-01,  4.81840186e-02,
        4.96891201e-01, -1.13950826e-01, -1.26991868e-01,  1.96694598e-01,
        2.24233404e-01, -1.09532759e-01,  3.35862562e-02, -6.13123551e-02,
       -1.65483892e-01,  7.91282952e-02,  2.32260168e-01, -9.89127457e-02,
        6.15927503e-02, -5.94200306e-02, -1.13176942e-01, -1.43245026e-01,
        4.04843353e-02,  4.04525101e-02,  1.01690866e-01, -1.27469599e-01,
        1.79372475e-01,  8.54947884e-03, -6.87049776e-02, -1.03469342e-01,
       -1.74782470e-01, -3.14439423e-02,  7.86394253e-03, -7.39028305e-02,
        1.28126323e-01, -7.37494556e-04, -4.03786488e-02, -3.55136901e-01,
        6.58708392e-04, -6.45819902e-01,  5.51453903e-02,  6.59572855e-02,
        8.51853117e-02,  2.31994782e-02, -7.81274140e-02,  4.84062210e-02,
        9.83427167e-02, -1.93256661e-01, -8.54927525e-02, -1.97760046e-01,
       -4.53477129e-02,  1.87432542e-01,  1.64963678e-02,  1.82803810e-01,
       -1.51019812e-01,  3.00113577e-02, -3.40518691e-02, -1.36199057e-01,
       -1.09971039e-01,  5.22130355e-02,  9.93974432e-02,  7.75398612e-02,
        7.11524785e-02, -9.28456709e-02,  1.10590339e-01, -3.21030527e-01,
        3.59029770e-02,  1.07188486e-01,  6.40853271e-02,  1.46313354e-01,
        1.45178407e-01,  1.86467335e-01,  1.71719771e-02, -1.83345899e-01,
        1.73412189e-01,  2.77678035e-02,  3.76823694e-02,  1.46073982e-01,
       -2.32495025e-01,  3.59911397e-02,  2.27334887e-01,  1.44411819e-02,
       -5.48890047e-02, -1.94932392e-03, -1.03721850e-01, -8.00701678e-02,
        1.29282027e-01, -1.84256241e-01,  4.68739606e-02, -2.47445572e-02,
        4.41086739e-02,  1.19201159e-02,  5.51018082e-02, -5.52359597e-06,
       -1.46044660e-02,  2.62233652e-02, -5.32456748e-02,  1.09746195e-01,
       -1.77315980e-01, -3.52810360e-02, -1.33073227e-02, -3.16976868e-02,
       -6.04879260e-02,  6.67593628e-02, -1.02117561e-01, -1.10090911e-01,
       -8.40803981e-02,  8.96042138e-02,  3.67189907e-02,  5.95313422e-02,
        4.12724074e-03,  1.94250159e-02,  1.06797479e-01, -9.47038159e-02,
        4.41765226e-02,  1.76643074e-01, -3.46676320e-01, -6.42103031e-02,
        5.91334254e-02,  4.17616069e-02,  9.21220854e-02, -1.72658920e-01],
      dtype=float32)
```