最美情侣中文字幕电影,在线麻豆精品传媒,在线网站高清黄,久久黄色视频

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊(cè)

R語(yǔ)言文本挖掘使用tf-idf分析NASA元數(shù)據(jù)的關(guān)鍵字

2021-03-01 23:19 作者:拓端tecdat  | 我要投稿

原文鏈接:http://tecdat.cn/?p=9448

目錄

?

獲取和整理NASA元數(shù)據(jù)

計(jì)算tf-idf

關(guān)鍵字和描述

可視化結(jié)果

NASA有32,000多個(gè)數(shù)據(jù)集,有關(guān)NASA數(shù)據(jù)集的元數(shù)據(jù)??可以JSON格式在線獲得。我們使用tf-idf在描述字段中找到重要的單詞,并將其與關(guān)鍵字聯(lián)系起來(lái)。

獲取和整理NASA元數(shù)據(jù)

讓我們下載32,000多個(gè)NASA數(shù)據(jù)集的元數(shù)據(jù)。

  1. library(jsonlite)

  2. library(dplyr)

  3. library(tidyr)

  4. metadata <- fromJSON("data.json")

  5. names(metadata$dataset)

  6. ## ?[1] "_id" ? ? ? ? ? ? ? ?"@type" ? ? ? ? ? ? ?"accessLevel" ? ? ? ?"accrualPeriodicity"

  7. ## ?[5] "bureauCode" ? ? ? ? "contactPoint" ? ? ? "description" ? ? ? ?"distribution"

  8. ## ?[9] "identifier" ? ? ? ? "issued" ? ? ? ? ? ? "keyword" ? ? ? ? ? ?"landingPage"

  9. ## [13] "language" ? ? ? ? ? "modified" ? ? ? ? ? "programCode" ? ? ? ?"publisher"

  10. ## [17] "spatial" ? ? ? ? ? ?"temporal" ? ? ? ? ? "theme" ? ? ? ? ? ? ?"title"

  11. ## [21] "license" ? ? ? ? ? ?"isPartOf" ? ? ? ? ? "references" ? ? ? ? "rights"

  12. ## [25] "describedBy"

  13. nasadesc <- data_frame(id = metadata$dataset$`_id`$`$oid`, desc = metadata$dataset$description)

  14. nasadesc

  15. ## # A tibble: 32,089 x 2

  16. ## ? ? ? ? ? ? ? ? ? ? ? ? ?id

  17. ## ? ? ? ? ? ? ? ? ? ? ? <chr>

  18. ## 1 ?55942a57c63a7fe59b495a77

  19. ## 2 ?55942a57c63a7fe59b495a78

  20. ## 3 ?55942a58c63a7fe59b495a79

  21. ## 4 ?55942a58c63a7fe59b495a7a

  22. ## 5 ?55942a58c63a7fe59b495a7b

  23. ## 6 ?55942a58c63a7fe59b495a7c

  24. ## 7 ?55942a58c63a7fe59b495a7d

  25. ## 8 ?55942a58c63a7fe59b495a7e

  26. ## 9 ?55942a58c63a7fe59b495a7f

  27. ## 10 55942a58c63a7fe59b495a80

  28. ## # ... with 32,079 more rows, and 1 more variables: desc <chr>

?

  1. ## # A tibble: 32,089 x 2

  2. ## ? ? ? ? ? ? ? ? ? ? ? ? ?id

  3. ## ? ? ? ? ? ? ? ? ? ? ? <chr>

  4. ## 1 ?55942a57c63a7fe59b495a77

  5. ## 2 ?55942a57c63a7fe59b495a78

  6. ## 3 ?55942a58c63a7fe59b495a79

  7. ## 4 ?55942a58c63a7fe59b495a7a

  8. ## 5 ?55942a58c63a7fe59b495a7b

  9. ## 6 ?55942a58c63a7fe59b495a7c

  10. ## 7 ?55942a58c63a7fe59b495a7d

  11. ## 8 ?55942a58c63a7fe59b495a7e

  12. ## 9 ?55942a58c63a7fe59b495a7f

  13. ## 10 55942a58c63a7fe59b495a80

  14. ## # ... with 32,079 more rows, and 1 more variables: desc <chr>

讓我們輸出其中的一部分。

?

  1. nasadesc %>% select(desc) %>% sample_n(5)

  2. ## # A tibble: 5 x 1

  3. ## ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?desc

  4. ## ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <chr>

  5. ## 1 ?A Group for High Resolution Sea Surface Temperature (GHRSST) Level 4 sea surface temperature analysis produced as a retrospective dataset at the JPL P

  6. ## 2 ?ML2CO is the EOS Aura Microwave Limb Sounder (MLS) standard product for carbon monoxide derived from radiances measured by the 640 GHz radiometer. The

  7. ## 3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?Crew lock bag. Polygons: 405 Vertices: 514

  8. ## 4 ?JEM Engineering proved the technical feasibility of the FlexScan array?a very low-cost, highly-efficient, wideband phased array antenna?in Phase I, an

  9. ## 5 MODIS (or Moderate Resolution Imaging Spectroradiometer) is a key instrument aboard the\nTerra (EOS AM) and Aqua (EOS PM) satellites. Terra's orbit aro

這是關(guān)鍵詞。

  1. ## # A tibble: 126,814 x 2

  2. ## ? ? ? ? ? ? ? ? ? ? ? ? ?id ? ? ? keyword

  3. ## ? ? ? ? ? ? ? ? ? ? ? <chr> ? ? ? ? <chr>

  4. ## 1 ?55942a57c63a7fe59b495a77 EARTH SCIENCE

  5. ## 2 ?55942a57c63a7fe59b495a77 ? HYDROSPHERE

  6. ## 3 ?55942a57c63a7fe59b495a77 SURFACE WATER

  7. ## 4 ?55942a57c63a7fe59b495a78 EARTH SCIENCE

  8. ## 5 ?55942a57c63a7fe59b495a78 ? HYDROSPHERE

  9. ## 6 ?55942a57c63a7fe59b495a78 SURFACE WATER

  10. ## 7 ?55942a58c63a7fe59b495a79 EARTH SCIENCE

  11. ## 8 ?55942a58c63a7fe59b495a79 ? HYDROSPHERE

  12. ## 9 ?55942a58c63a7fe59b495a79 SURFACE WATER

  13. ## 10 55942a58c63a7fe59b495a7a EARTH SCIENCE

  14. ## # ... with 126,804 more rows

最常見(jiàn)的關(guān)鍵字是什么?

  1. ## # A tibble: 1,774 x 2

  2. ## ? ? ? ? ? ? ? ? ? ?keyword ? ? n

  3. ## ? ? ? ? ? ? ? ? ? ? ?<chr> <int>

  4. ## 1 ? ? ? ? ? ?EARTH SCIENCE 14362

  5. ## 2 ? ? ? ? ? ? ? ? ?Project ?7452

  6. ## 3 ? ? ? ? ? ? ? ATMOSPHERE ?7321

  7. ## 4 ? ? ? ? ? ? ?Ocean Color ?7268

  8. ## 5 ? ? ? ? ? ? Ocean Optics ?7268

  9. ## 6 ? ? ? ? ? ? ? ? ? Oceans ?7268

  10. ## 7 ? ? ? ? ? ? ? ?completed ?6452

  11. ## 8 ?ATMOSPHERIC WATER VAPOR ?3142

  12. ## 9 ? ? ? ? ? ? ? ? ? OCEANS ?2765

  13. ## 10 ? ? ? ? ? ?LAND SURFACE ?2720

  14. ## # ... with 1,764 more rows

看起來(lái)“已完成項(xiàng)目”對(duì)于某些目的來(lái)說(shuō)可能不是有用的關(guān)鍵字,我們可能希望將所有這些都更改為小寫(xiě)或大寫(xiě),以消除如“ OCEANS”和“ Oceans”之類(lèi)的重復(fù)項(xiàng)。

計(jì)算文字的tf-idf

什么是tf-idf?評(píng)估文檔中單詞的重要性的一種方法可能是其??術(shù)語(yǔ)頻率??(tf),即單詞在文檔中出現(xiàn)的頻率。但是,一些經(jīng)常出現(xiàn)的單詞并不重要。在英語(yǔ)中,這些詞可能是“ the”,“ is”,“ of”等詞。另一種方法是查看術(shù)語(yǔ)的??逆文本頻率指數(shù)?(idf),這會(huì)降低常用單詞的權(quán)重,而增加在文檔集中很少使用的單詞的權(quán)重。

  1. ## # A tibble: 2,728,224 x 3

  2. ## ? ? ? ? ? ? ? ? ? ? ? ? ?id ?word ? ? n

  3. ## ? ? ? ? ? ? ? ? ? ? ? <chr> <chr> <int>

  4. ## 1 ?55942a88c63a7fe59b498280 ? amp ? 679

  5. ## 2 ?55942a88c63a7fe59b498280 ?nbsp ? 655

  6. ## 3 ?55942a8ec63a7fe59b4986ef ? ?gt ? 330

  7. ## 4 ?55942a8ec63a7fe59b4986ef ? ?lt ? 330

  8. ## 5 ?55942a8ec63a7fe59b4986ef ? ? p ? 327

  9. ## 6 ?55942a8ec63a7fe59b4986ef ? the ? 231

  10. ## 7 ?55942a86c63a7fe59b49803b ? amp ? 208

  11. ## 8 ?55942a86c63a7fe59b49803b ?nbsp ? 204

  12. ## 9 ?56cf5b00a759fdadc44e564a ? the ? 201

  13. ## 10 55942a86c63a7fe59b4980a2 ? ?gt ? 191

  14. ## # ... with 2,728,214 more rows

這些是NASA字段中最常見(jiàn)的“單詞”,是詞頻最高的單詞。讓我們看一下第一個(gè)數(shù)據(jù)集,例如:

  1. ## # A tibble: 1 x 1

  2. ## ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? desc

  3. ## ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?<chr>

  4. ## 1 The objective of the Variable Oxygen Regulator Element is to develop an oxygen-rated, contaminant-tolerant oxygen regulator to control suit p

tf-idf算法應(yīng)該減少所有這些的權(quán)重,因?yàn)樗鼈兒艹R?jiàn),但是我們可以根據(jù)需要通過(guò)停用詞將其刪除?,F(xiàn)在,讓我們?yōu)槊枋鲎侄沃械乃袉卧~計(jì)算tf-idf。

  1. ## # A tibble: 2,728,224 x 6

  2. ## ? ? ? ? ? ? ? ? ? ? ? ? ?id ?word ? ? n ? ? ? ? tf ? ? ? idf ? ? ?tf_idf

  3. ## ? ? ? ? ? ? ? ? ? ? ? <chr> <chr> <int> ? ? ?<dbl> ? ? <dbl> ? ? ? <dbl>

  4. ## 1 ?55942a88c63a7fe59b498280 ? amp ? 679 0.35661765 3.1810813 1.134429711

  5. ## 2 ?55942a88c63a7fe59b498280 ?nbsp ? 655 0.34401261 4.2066578 1.447143322

  6. ## 3 ?55942a8ec63a7fe59b4986ef ? ?gt ? 330 0.05722213 3.2263517 0.184618705

  7. ## 4 ?55942a8ec63a7fe59b4986ef ? ?lt ? 330 0.05722213 3.2903671 0.188281801

  8. ## 5 ?55942a8ec63a7fe59b4986ef ? ? p ? 327 0.05670192 3.3741126 0.191318680

  9. ## 6 ?55942a8ec63a7fe59b4986ef ? the ? 231 0.04005549 0.1485621 0.005950728

  10. ## 7 ?55942a86c63a7fe59b49803b ? amp ? 208 0.32911392 3.1810813 1.046938133

  11. ## 8 ?55942a86c63a7fe59b49803b ?nbsp ? 204 0.32278481 4.2066578 1.357845252

  12. ## 9 ?56cf5b00a759fdadc44e564a ? the ? 201 0.06962245 0.1485621 0.010343258

  13. ## 10 55942a86c63a7fe59b4980a2 ? ?gt ? 191 0.12290862 3.2263517 0.396546449

  14. ## # ... with 2,728,214 more rows

添加的列是tf,idf,這兩個(gè)數(shù)量相乘在一起是tf-idf。NASA描述字段中最高的tf-idf詞是什么?

  1. ## # A tibble: 2,728,224 x 6

  2. ## ? ? ? ? ? ? ? ? ? ? ? ? ?id ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?word ? ? n ? ?tf ? ? ? idf

  3. ## ? ? ? ? ? ? ? ? ? ? ? <chr> ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? <chr> <int> <dbl> ? ? <dbl>

  4. ## 1 ?55942a7cc63a7fe59b49774a ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? rdr ? ? 1 ? ? 1 10.376269

  5. ## 2 ?55942ac9c63a7fe59b49b688 palsar_radiometric_terrain_corrected_high_res ? ? 1 ? ? 1 10.376269

  6. ## 3 ?55942ac9c63a7fe59b49b689 ?palsar_radiometric_terrain_corrected_low_res ? ? 1 ? ? 1 10.376269

  7. ## 4 ?55942a7bc63a7fe59b4976ca ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?lgrs ? ? 1 ? ? 1 ?8.766831

  8. ## 5 ?55942a7bc63a7fe59b4976d2 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?lgrs ? ? 1 ? ? 1 ?8.766831

  9. ## 6 ?55942a7bc63a7fe59b4976e3 ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?lgrs ? ? 1 ? ? 1 ?8.766831

  10. ## 7 ?55942ad8c63a7fe59b49cf6c ? ? ? ? ? ? ? ? ? ? ?template_proddescription ? ? 1 ? ? 1 ?8.296827

  11. ## 8 ?55942ad8c63a7fe59b49cf6d ? ? ? ? ? ? ? ? ? ? ?template_proddescription ? ? 1 ? ? 1 ?8.296827

  12. ## 9 ?55942ad8c63a7fe59b49cf6e ? ? ? ? ? ? ? ? ? ? ?template_proddescription ? ? 1 ? ? 1 ?8.296827

  13. ## 10 55942ad8c63a7fe59b49cf6f ? ? ? ? ? ? ? ? ? ? ?template_proddescription ? ? 1 ? ? 1 ?8.296827

  14. ## ? ? ? tf_idf

  15. ## ? ? ? ?<dbl>

  16. ## 1 ?10.376269

  17. ## 2 ?10.376269

  18. ## 3 ?10.376269

  19. ## 4 ? 8.766831

  20. ## 5 ? 8.766831

  21. ## 6 ? 8.766831

  22. ## 7 ? 8.296827

  23. ## 8 ? 8.296827

  24. ## 9 ? 8.296827

  25. ## 10 ?8.296827

  26. ## # ... with 2,728,214 more rows

因此,這些是用tf-idf衡量的描述字段中最“重要”的詞,這意味著它們很常見(jiàn),但不太常用。

  1. ## # A tibble: 1 x 1

  2. ## ? ?desc

  3. ## ? <chr>

  4. ## 1 ? RDR

tf-idf算法認(rèn)為這非常重要的詞。

關(guān)鍵字和描述

因此,現(xiàn)在我們知道描述中的哪個(gè)詞具有較高的tf-idf,并且在關(guān)鍵字中也有這些描述的標(biāo)簽。

  1. ## # A tibble: 11,013,838 x 7

  2. ## ? ? ? ? ? ? ? ? ? ? ? ? ?id ?word ? ? n ? ? ? ? tf ? ? ?idf ? ?tf_idf ? ? ? ? ? ? ?keyword

  3. ## ? ? ? ? ? ? ? ? ? ? ? <chr> <chr> <int> ? ? ?<dbl> ? ?<dbl> ? ? <dbl> ? ? ? ? ? ? ? ?<chr>

  4. ## 1 ?55942a88c63a7fe59b498280 ? amp ? 679 0.35661765 3.181081 1.1344297 ? ? ? ? ? ? ?ELEMENT

  5. ## 2 ?55942a88c63a7fe59b498280 ? amp ? 679 0.35661765 3.181081 1.1344297 JOHNSON SPACE CENTER

  6. ## 3 ?55942a88c63a7fe59b498280 ? amp ? 679 0.35661765 3.181081 1.1344297 ? ? ? ? ? ? ? ? ?VOR

  7. ## 4 ?55942a88c63a7fe59b498280 ? amp ? 679 0.35661765 3.181081 1.1344297 ? ? ? ? ? ? ? ACTIVE

  8. ## 5 ?55942a88c63a7fe59b498280 ?nbsp ? 655 0.34401261 4.206658 1.4471433 ? ? ? ? ? ? ?ELEMENT

  9. ## 6 ?55942a88c63a7fe59b498280 ?nbsp ? 655 0.34401261 4.206658 1.4471433 JOHNSON SPACE CENTER

  10. ## 7 ?55942a88c63a7fe59b498280 ?nbsp ? 655 0.34401261 4.206658 1.4471433 ? ? ? ? ? ? ? ? ?VOR

  11. ## 8 ?55942a88c63a7fe59b498280 ?nbsp ? 655 0.34401261 4.206658 1.4471433 ? ? ? ? ? ? ? ACTIVE

  12. ## 9 ?55942a8ec63a7fe59b4986ef ? ?gt ? 330 0.05722213 3.226352 0.1846187 JOHNSON SPACE CENTER

  13. ## 10 55942a8ec63a7fe59b4986ef ? ?gt ? 330 0.05722213 3.226352 0.1846187 ? ? ? ? ? ? ?PROJECT

  14. ## # ... with 11,013,828 more rows

可視化結(jié)果

讓我們來(lái)看幾個(gè)示例關(guān)鍵字中最重要的單詞。

  1. ## # A tibble: 122 x 7

  2. ## ? ? ? ? ? ? ? ? ? ? ? ? ?id ? ? ?word ? ? n ? ? ? ?tf ? ? ?idf ? tf_idf ? ?keyword

  3. ## ? ? ? ? ? ? ? ? ? ? ? <chr> ? ?<fctr> <int> ? ? <dbl> ? ?<dbl> ? ?<dbl> ? ? ?<chr>

  4. ## 1 ?55942a60c63a7fe59b49612f estimates ? ? 1 0.5000000 3.172863 1.586432 ? ? CLOUDS

  5. ## 2 ?55942a76c63a7fe59b49728d ? ? ?ncdc ? ? 1 0.1666667 7.603680 1.267280 ? ? CLOUDS

  6. ## 3 ?55942a60c63a7fe59b49612f ? ? cloud ? ? 1 0.5000000 2.464212 1.232106 ? ? CLOUDS

  7. ## 4 ?55942a5ac63a7fe59b495bd8 ? ? ?fife ? ? 1 0.2000000 5.910360 1.182072 ? ? CLOUDS

  8. ## 5 ?55942a5cc63a7fe59b495deb allometry ? ? 1 0.1428571 7.891362 1.127337 VEGETATION

  9. ## 6 ?55942a5dc63a7fe59b495ede ? ? ? tgb ? ? 3 0.1875000 5.945452 1.114772 VEGETATION

  10. ## 7 ?55942a5ac63a7fe59b495bd8 ? ? ?tovs ? ? 1 0.2000000 5.524238 1.104848 ? ? CLOUDS

  11. ## 8 ?55942a5ac63a7fe59b495bd8 ?received ? ? 1 0.2000000 5.332843 1.066569 ? ? CLOUDS

  12. ## 9 ?55942a5cc63a7fe59b495dfd ? ? ? sap ? ? 1 0.1250000 8.430358 1.053795 VEGETATION

  13. ## 10 55942a60c63a7fe59b496131 ?abstract ? ? 1 0.3333333 3.118561 1.039520 ? ? CLOUDS

  14. ## # ... with 112 more rows

?

  1. ## # A tibble: 1 x 1

  2. ## ? ? ? ? ? ? ?desc

  3. ## ? ? ? ? ? ? <chr>

  4. ## 1 Cloud estimates

tf-idf算法在僅2個(gè)字長(zhǎng)的描述中無(wú)法很好地工作,或者它將對(duì)這些字加權(quán)過(guò)重。這是不合適的。

?

最受歡迎的見(jiàn)解

1.探析大數(shù)據(jù)期刊文章研究熱點(diǎn)

2.618網(wǎng)購(gòu)數(shù)據(jù)盤(pán)點(diǎn)-剁手族在關(guān)注什么

3.r語(yǔ)言文本挖掘tf-idf主題建模,情感分析n-gram建模研究

4.python主題建模可視化lda和t-sne交互式可視化

5.疫情下的新聞數(shù)據(jù)觀察

6.python主題lda建模和t-sne可視化

7.r語(yǔ)言中對(duì)文本數(shù)據(jù)進(jìn)行主題模型topic-modeling分析

8.主題模型:數(shù)據(jù)聆聽(tīng)人民網(wǎng)留言板的那些“網(wǎng)事”

9.python爬蟲(chóng)進(jìn)行web抓取lda主題語(yǔ)義數(shù)據(jù)分析

?


R語(yǔ)言文本挖掘使用tf-idf分析NASA元數(shù)據(jù)的關(guān)鍵字的評(píng)論 (共 條)

使用qq登录你需要登录后才可以评论。
荃湾区| 平乐县| 都江堰市| 陈巴尔虎旗| 金乡县| 池州市| 凤翔县| 普格县| 东莞市| 昌乐县| 定州市| 黔西| 桐梓县| 新干县| 阿勒泰市| 柳州市| 宣城市| 永嘉县| 黑河市| 泗阳县| 蒲城县| 绩溪县| 民权县| 襄汾县| 瑞金市| 休宁县| 贡嘎县| 黔江区| 林州市| 汾西县| 濮阳市| 疏附县| 长治县| 高平市| 漳浦县| 泸定县| 奉新县| 泌阳县| 靖江市| 建德市| 定安县|