我的目标是使用library(visNetwork)
的潜在Dirichlet分配输出,使用library(text2vec)
构建每个主题最多包含100个频率词的网络地图。
在一开始,我曾考虑过使用术语“共生矩阵”(tcm)输出,但是,
visNetwork(nodes, edges)
上结果的方法。lda_model$get_top_words(n = 100, lambda = 1)
可以根据我选择的lambda来获取每个主题的单词概率,但是我不是完全知道它是否适合代表每个主题中的单词,请原谅我这么辛苦。这是我从tcm得到的结果:
drive_element housing_portion pump_housing setting_unit supplying_electric_power (...)
drive_element 2 0 0 0 0.0
housing_portion 0 1 0 0 0.0
pump_housing 0 0 2 0 0.0
setting_unit 0 0 0 0 0.0
supplying_electric_power 0 0 0 0 0.2
(...)
这是我得到的结果
[,1] [,2] [,3]
[1,] "electric_motor" "power_transmission" "electric_motor"
[2,] "permanent_magnet" "output_shaft" "combustion_engine"
[3,] "stator_core" "power_source" "internal_combustion"
[4,] "iron_core" "control_device" "internal_combustion_engine"
[5,] "axial_direction" "input_shaft" "hybrid_vehicle"
[6,] "compression_mechanism" "drive_power" "control_device"
[7,] "rotating_shaft" "transmission_device" "motor_generator"
[8,] "outer_peripheral" "rotation_speed" "engine_electric"
[9,] "main_body" "power_transmitting" "engine_electric_motor"
[10,] "electric_machine" "transmission_mechanism" "braking_force"
(...) (...) (...)
[,4] [,5] [,6]
[1,] "power_source" "drive_shaft" "power_tool"
[2,] "control_circuit" "storage_device" "battery_pack"
[3,] "switching_element" "power_storage" "tool_includes"
[4,] "power_supply" "driving_shaft" "power_tool_includes"
[5,] "direct_current" "power_storage_device" "hand_power"
[6,] "current_power" "high_pressure" "hand_power_tool"
[7,] "light_source" "swash_plate" "tool_holder"
[8,] "high_voltage" "shaft_drive" "tool_body"
[9,] "light_emitting" "figure_figure" "electric_power_tool"
[10,] "alternating_current" "drive_motor" "main_body"
(...) (...) (...)
[,7] [,8] [,9]
[1,] "power_source" "electric_motor" "handle_assembly"
[2,] "electric_power" "control_unit" "assembly_includes"
[3,] "power_supply" "control_device" "longitudinal_axis"
[4,] "external_power" "motor_control" "jaw_member"
[5,] "external_power_source" "rotational_speed" "surgical_instrument"
[6,] "secondary_battery" "electric_power" "body_portion"
[7,] "fuel_cell" "command_value" "anvil_assembly"
[8,] "storage_battery" "rotation_speed" "distal_portion"
[9,] "power_supplied" "electric_motor_control" "jaw_members"
[10,] "source_power" "motor_driving" "includes_handle"
(...) (...) (...)
[,10]
[1,] "ac_power"
[2,] "power_supply"
[3,] "dc_power"
[4,] "power_conversion"
[5,] "ac_power_supply"
[6,] "high_frequency"
[7,] "dc_voltage"
[8,] "power_converter"
[9,] "power_source"
[10,] "inverter_circuit"
(...)