3、关键词怎么提取
文章关键词提取软件(文章关键词提取软件下载)
大家好!今天让创意岭的小编来大家介绍下关于文章关键词提取软件的问题,以下是小编对此问题的归纳整理,让我们一起来看看吧。
开始之前先推荐一个非常厉害的Ai人工智能工具,一键生成原创文章、方案、文案、工作计划、工作报告、论文、代码、作文、做题和对话答疑等等
只需要输入关键词,就能返回你想要的内容,越精准,写出的就越详细,有微信小程序端、在线网页版、PC客户端
本文目录:
一、求一个提取文章关键词的java程序
//直接粘贴就行。
import java.awt.BorderLayout;
import java.awt.EventQueue;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Scanner;
import javax.swing.BorderFactory;
import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.JTextArea;
import javax.swing.border.EtchedBorder;
import javax.swing.filechooser.FileFilter;
public class Application2 extends JFrame implements Cloneable{
public Application2(){
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setSize(800,700);
this.setLayout(new BorderLayout());
keyWords1=new String[]{"那么","还是","sdf"};
keyWords2=new String[]{"所以","而且",};
input=new JTextArea();
JPanel ip=new JPanel();
ip.setLayout(new BorderLayout());
ip.add(input,BorderLayout.CENTER);
ip.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "输入文本"));
output1=new JTextArea();
JPanel o1p=new JPanel();
o1p.setLayout(new BorderLayout());
o1p.add(output1,BorderLayout.CENTER);
o1p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "以下为"));
output2=new JTextArea();
JPanel o2p=new JPanel();
o2p.setLayout(new BorderLayout());
o2p.add(output2,BorderLayout.CENTER);
o2p.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "以下为"));
JSplitPane split1=new JSplitPane(JSplitPane.HORIZONTAL_SPLIT,o1p,o2p);
split1.setDividerLocation(350);
JSplitPane split2=new JSplitPane(JSplitPane.VERTICAL_SPLIT,ip,split1);
split2.setDividerLocation(300);
this.add(split2,BorderLayout.CENTER);
open=new JButton("导入");
open.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
JFileChooser chooser=new JFileChooser(".");
chooser.setMultiSelectionEnabled(false);
chooser.addChoosableFileFilter(new FileFilter(){
@Override
public boolean accept(File file) {
if(file.isDirectory())
return true;
int length=file.getName().length();
if(length<5)
return false;
if(file.getName().substring(length-4).equals(".txt"))
return true;
return false;
}
@Override
public String getDescription() {
return "文本文件";
}
});
chooser.showOpenDialog(Application2.this);
File file=chooser.getSelectedFile();
if(file==null)
return;
try {
Scanner sc=new Scanner(file);
String text="";
while(sc.hasNextLine())
text+=sc.nextLine()+"\n";
input.setText(text);
String[] array=getSentences();
output1.setText(getKeySentences(keyWords1,array));
output2.setText(getKeySentences(keyWords2,array));
}catch (IOException e1) {
e1.printStackTrace();
}
}
});
save=new JButton("导出");
save.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e){
JFileChooser chooser=new JFileChooser(".");
chooser.setMultiSelectionEnabled(false);
chooser.addChoosableFileFilter(new FileFilter(){
@Override
public boolean accept(File file) {
if(file.isDirectory())
return true;
int length=file.getName().length();
if(length<5)
return false;
if(file.getName().substring(length-4).equals(".txt"))
return true;
return false;
}
@Override
public String getDescription() {
return "文本文件";
}
});
chooser.showSaveDialog(Application2.this);
File file=chooser.getSelectedFile();
if(file==null)
return;
try {
PrintWriter pw=new PrintWriter(file);
pw.print(output1.getText());
pw.flush();
pw.print(output2.getText());
pw.flush();
}catch (IOException e1) {
e1.printStackTrace();
}
}
});
JPanel buttonPane=new JPanel();
buttonPane.add(open);
buttonPane.add(save);
this.add(buttonPane,BorderLayout.SOUTH);
}
public String[] getSentences(){
ArrayList<String> set=new ArrayList<String>();
int length=input.getText().length();
for(int i=0,last=0;i<length;i++){
String s=String.valueOf(input.getText().charAt(i));
if(s.equals("\n"))
last=i+1;
if(s.equals(".")||s.equals(",")||s.equals("。")||s.equals("。")||s.equals("!")||s.equals("?")||s.equals("?")||s.equals("!")||s.equals(",")){
set.add(input.getText().substring(last,i)+s);
last=i+1;
}
}
return set.<String>toArray(new String[set.size()]);
}
public String getKeySentences(String[] key,String[] sentences){
String result="";
A: for(int i=0;i<sentences.length;i++){
for (int k = 0; k < key.length; k++)
if (sentences[i].contains(key[k].subSequence(0, key[k].length()))) {
result += sentences[i] + "\n";
continue A;
}
}
return result;
}
private JTextArea input;
private JTextArea output1;
private JTextArea output2;
private JButton open;
private JButton save;
private String[] keyWords1;
private String[] keyWords2;
public static void main(String... args){
EventQueue.invokeLater(new Runnable(){
public void run(){
new Application2().setVisible(true);
}
});
}
}
二、如何用WPS或者Word自动提取关键词?或者显示词频较高的词?
文字软件恐怕还没有你说的那么智能,可以自主分析关键词。它只可以提取出现频率较高的词语。当然我对Word、wps的功能并不完全精通,也许有高手可以帮你解决这个问题
三、关键词怎么提取
在巨量的信息面前,很多信息是我们无法全面接收,因此我们需要从中筛选出一些我们感兴趣的或者有代表性的信息进行接收。那么这一个过程就是关键词提取技术。如果我们可以准确的将所有的文档都用几个简单的关键词描述,那么我们便可以通过关键词了解一篇文章的内容,这将会提高信息获取到效率。想要在海量的信息里提取出我们所需要的信息,就需要学会如何提取关键词。
一,TF-IDF算法(Term Frequency-Inverse Document Frequency,词频-逆文档频次算法)是一种基于统计的计算方法,常用于评估在一个文档集中一个词对某份文档的重要程度。这种思想是符合关键词抽取的需求,一个词语对文档越重要,那么是关键词的概率就越大,所以通常将TF-IDF算法应用在关键词提取中。
二,在上述的TF-IDF算法中,都需要基于一个现成的语料库,主题模型的关键词提取算法则是需要通过对大规模文档学习,发现文档的隐含主题。
三,而TextRank算法则是可以脱离语料库的基础,仅对单篇文档进行分析就可以提取该文档的关键词。这也是TextRank算法的重要特点。TextRank算法的基本思想源于Google的PageRank算法。因此这里需要先了解下PageRank算法。
四、要在一万多篇文章的关键词中统计各关键词的频数,应该怎么做?有没有相应的软件?
用软件Replace Pioneer可以完成,详细步骤:
1.首先准备一个关键词文件,每行是一个你需要统计的关键词,出现两遍,中间用空格或逗号隔开,格式如下:
关键词1 关键词1
关键词2 关键词2
关键词3 关键词3
...
2. 打开replace pioneer的Tools->pattern counter菜单,点击import按钮把上面的文件导入。
3. 在pattern counter菜单中选择File/http选项,并在后面输入要统计的文件,然后点击count即可得出每个关键词的频度。
以上是统计单个文件的步骤,如果统计多个文件,需要先把所有文件先连成一个大文件,然后同上操作。
以上就是关于文章关键词提取软件相关问题的回答。希望能帮到你,如有更多相关问题,您也可以联系我们的客服进行咨询,客服也会为您讲解更多精彩的知识和内容。
推荐阅读: