Skip to content

Commit

Permalink
文档修改
Browse files Browse the repository at this point in the history
  • Loading branch information
lingfengsan committed Jan 25, 2018
1 parent 895df8b commit 0711181
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
7 changes: 3 additions & 4 deletions README.md
Expand Up @@ -24,11 +24,10 @@

1. 将手机点击到直播界面(在这里我们先打开一张图片);
2. 用Adb 工具获取当前手机截图
3. 用tessOCR进行图像识别,提取文字;
3. 用OCR进行图像识别,提取文字;
4. 将文字中的问题和答案提取出来;
5. 使用百度搜索并打开网页,然后统计搜索得到结果数量
6. 计算pmi
7. 选择pmi值最高的为答案。
5. 使用搜索工具并打开网页
6. 计算问题和答案的相似度,此处调用百度的Nlp接口或者采用PMI的方式
> 该公式的依据来自于维基百科:
https://en.wikipedia.org/wiki/Pointwise_mutual_information
Expand Down
6 changes: 2 additions & 4 deletions src/main/java/MainGUI.java
Expand Up @@ -11,7 +11,6 @@
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.*;
import java.util.Properties;

/**
* Created by lingfengsan on 2018/1/16.
Expand All @@ -32,7 +31,6 @@ public class MainGUI {
private static JTextArea resultTextArea;
private static JFrame frame = new JFrame("答题助手");
private static final CommonPattern COMMON_PATTERN = new CommonPattern();
private static Properties heroProperties = new Properties();

public static void main(String[] args) throws IOException {
// Setting the width and height of frame
Expand Down Expand Up @@ -66,7 +64,7 @@ private static void addAdbPath(JPanel panel) {
JLabel adbPathLabel = new JLabel("adb路径:");
adbPathLabel.setBounds(10, 20, 100, 25);
panel.add(adbPathLabel);
adbPathText = new JTextField(heroProperties.getProperty("ADB_PATH"), 30);
adbPathText = new JTextField(Config.getAdbPath(), 30);
adbPathText.setBounds(100, 20, 100, 25);
panel.add(adbPathText);
}
Expand All @@ -76,7 +74,7 @@ private static void addImagePath(JPanel panel) {
JLabel imagePathLabel = new JLabel("图片存放路径:");
imagePathLabel.setBounds(10, 45, 100, 25);
panel.add(imagePathLabel);
imagePathText = new JTextField(heroProperties.getProperty("PHOTO_PATH"), 30);
imagePathText = new JTextField(Config.getPhotoPath(), 30);
imagePathText.setBounds(100, 45, 100, 25);
panel.add(imagePathText);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/similarity/impl/BaiDuSimilarity.java
Expand Up @@ -2,7 +2,6 @@

import com.baidu.aip.nlp.AipNlp;
import org.json.JSONObject;
import pojo.NlpConfig;
import similarity.Similarity;

import java.util.HashMap;
Expand Down

0 comments on commit 0711181

Please sign in to comment.