1.textrank算法实现工具有哪些
extRank算法基于PageRank,用于为文本生成关键字和摘要。
其论文是: Mihalcea R, Tarau P. TextRank: Bringing order into texts[C]. Association for Computational Linguistics, 2004.先从PageRank讲起。 PageRankPageRank最开始用来计算网页的重要性。
整个mend'时,表示推荐文档,等同于 {dede:coolart}{/dede:coolart}
§ type='image'时,表示必须含有缩略图片的文档,等同于{dede:imglist}{/dede:imglist}、{dede:imginfolist}{/dede:imginfolist}
§ type='spec'时,表示专题,等同于标记{dede:specart}{/dede:specart}
以上属性值可以联合使用,如: type='commend image' 表示推荐的图片文档
[9] orderby='' 表示排序方式,默认值是 senddate 按发布时间排列。
§ orderby='hot' 或 orderby='click' 表示按点击数排列
§ orderby='pubdate' 按出版时间排列(即是前台允许更改的时间值)
§ orderby='sortrank' 按文章的新排序级别排序(如果你想使用置顶文章则使用这个属性)
§ orderby='id' 按文章ID排序
§ orderby='postnum' 按文章评论次数排序
§ orderby='rand' 随机获得指定条件的文档列表
[10] orderway='' 值为 desc 或 asc ,指定排序方式是降序还是顺向排序,默认为降序。
[11] keyword='' 表示含有指定关键字的文档列表,多个关键字用","分开
[12] channelid='' 表示特定的频道模型ID,内置的频道:专题(-1)、文章(1)、图集(2)、Flash(4)、软件(3)
[13] limit='起始,结束' 表示限定的记录范围,row属性必须等于"结束 - 起始",mysql的limit语句是由0起始的,如 “limit 0,5”表示的是取前五笔记录,“limit 5,5”表示由第五笔记录起,取下五笔记录,使用了本属性后,row属性将无效。
[14] att='数值' 表示自定义属性值
[15] subday='天数' 表示在多少天以内的文档,通常用于获取指定天数的热门文档、推荐文档、热门评论文档等
[16] partsort='排列位数'表示自动获得父栏目的所有子数中排列在第几位的栏目ID,标记为 {dede:autolist}{/dede:autolist} 时,使用本属性才有效。
4.编写一个程序,对输入的4个整数,求出其中的最大值和最小值,请使
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
namespace baidu
{
class temp
{
public static void main()
{
array ();
}
public static void array()
{
int[] temp = new int[4];
temp = init(temp);
Console.WriteLine(temp.ToList().Max());
Console.WriteLine(temp.ToList().Min());
show(temp);
}
public static int[] init(int[] temp)
{
Random rm = new Random();
for (int i = 0; i < temp.Length; i++)
{
temp[i] = rm.Next(10000);
}
return temp;
}
public static int[,] init(int[,] temp)
{
Random rm = new Random();
int rank=temp.Rank ;
int line=temp.GetLength (0);
int row=temp.Length / line;
for (int j = 0; j < line; j++)
{
for (int i = 0; i < row ; i++)
{
temp[j, i] = rm.Next(9);
}
}
return temp;
}
public static void show(int[] temp)
{
for (int i = 0; i < temp.Length ; i++)
{
Console.Write(temp[i] + " ");
}
Console.WriteLine();
wline();
}
public static void show(int[,] temp)
{
int rank = temp.Rank;
int line = temp.GetLength(0);
int row = temp.Length / line;
for (int j = 0; j < line; j++)
{
for (int i = 0; i < row; i++)
{
Console.Write(temp[j, i]+" ");
}
Console.WriteLine();
}
wline();
}
public static void wline()
{
Console.WriteLine("-------------------------------------------------------------------");
}
}
}
转载请注明出处51数据库 » textrank4keyword