gpt4 book ai didi

r - 挑战: Duplicating Many Eyes Word Tree with R

转载 作者:行者123 更新时间:2023-12-04 04:26:19 25 4
gpt4 key购买 nike

IBM数据可视化实验的许多眼睛提供了一种非常有趣的可视化连续文本(例如语音或短语)的方法。本质上,您选择一个起始单词,并且为该单词之后的所有句子创建类似于树状图或树的内容,通常由所选单词之后的动词分解。

这里有一个示例:http://www-958.ibm.com/software/data/cognos/manyeyes/page/Word_Tree.html

尽管有一些交互组件,但我只关心图形本身。

在R中是否有执行此操作的现有方法?如果没有,您能想到一种方法吗(在R中)?我对他们如何分解一无所知。我很乐意为代表寻求解决方案,但也会接受一个经过深思熟虑的想法。

最佳答案

谷歌使用谷歌图表工具为此做出了杰出的贡献

https://developers.google.com/chart/interactive/docs/gallery/wordtree

you can easly generate your own by implicit script in above link - mine is Turkish

只需更改数据数组,如下所示。

<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {packages:['wordtree']});
google.charts.setOnLoadCallback(drawChart);

function drawChart() {
var data = google.visualization.arrayToDataTable(
[ ['Phrases'],
['abd adalet bakanligi fiat chrysler sorustur'],
['abd adalet bakanligi fiat chrysler sorusturma acti'],
['abd adalet bakanligi fiat chrysler sorusturma acti abd adalet bakanliginin fiat chrysler fca hakkinda dizel'],
['abd adalet bakanligi fiat chrysler sorusturma acti abd adalet bakanliginin fiat chrysler fca hakkinda dizel araclarinda emisyon'],
['abd adalet bakanligi fiat chrysler sorusturma acti haberin detaylari icin tiklayiniz'],
['abd adalet bakanligi fiat chrysler sorusturma acti kazakistan haber'],
['abd adalet bakanligi fiat chrysler sorusturma acti sondakika'],
]
);

var options = {
wordtree: {
format: 'implicit',
word: 'cats'
}
};

var chart = new google.visualization.WordTree(document.getElementById('wordtree_basic'));
chart.draw(data, options);
}
</script>
<body>
<div id="wordtree_basic" style="width: 900px; height: 500px;"></div>
</body>

关于r - 挑战: Duplicating Many Eyes Word Tree with R,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13547832/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com