AI怎么批改数学作业

一、简单计算题

1、用ocr将拍摄的数学题识别出来。
2、等号的左边是中缀表达式 ,利用2个栈,将数字与运算符分别压栈,左边是数字,右边是运算符,如果新压栈的运算符比栈顶的运算符优先值低,则弹出栈顶的2个数字,以及栈顶的运算符进行运算,将结果压栈,让递归进行得到运算结果与等号的右边进行比较。

代码实现:

       <dependency>
            <groupId>com.googlecode.aviator</groupId>
            <artifactId>aviator</artifactId>
            <version>2.3.3</version>
        </dependency>
import com.googlecode.aviator.AviatorEvaluator;

public class TestAviator {
    
    

    public static void main(String[] args) {
    
    
        String A = "1*3+4=5";
        String[] split = A.split("=");
        System.out.println(calculation(split[0]));
    }


    private static Object calculation(String formula){
    
    
         return  AviatorEvaluator.execute(formula);
    }
}

二、复杂公式题

1、用ocr将拍摄的数学题识别出来。
2、http://zzllrr.gitee.io/mather/一款基于web网页的覆盖数学全部学科的数学开源软件。
3、数学表达式解析器 Expression4J。

 private static void mathematicalExpression() throws ParsingException, EvalException {
    
    
        //不能有空格
        Expression exp = ExpressionFactory.createExpression("f()=2.4e-2*1000");
        double val = exp.evaluate(null).getRealValue();
        System.out.println("exp name:" + exp.getName());
        System.out.println("exp:" + exp);
        System.out.println("result:" + val);
 }

4、数学表达式解析器 muParserX。
5、数学表达式解析器 Jep。
6、表达式解析器 ExpressionAnalyzer。
7、https://github.com/dengsgo/math-engine

能够处理的表达式样例:

1+127-21+(3-4)*6/2.5
(88+(1+8)*6)/2+99
123_345_456 * 1.5 - 2 ^ 4
-4 * 6 + 2e2 - 1.6e-3
sin(pi/2)+cos(45-45*1)+tan(pi/4)
99+abs(-1)-ceil(88.8)+floor(88.8)
max(min(2^3, 3^2), 10*1.5-7)
double(6) + 3 , double是一个自定义的函数

三、应用题

1、利用文本相似度计算,将通过ocr识别出来的文本与题库的题目进行比对,找到相似度最高的题目,直接给出相应的答案。
2、利用Word2vec简单的计算文本相似度。
3、使用simhash计算文本相似度。
4、使用余弦相似度计算文本相似度。
5、使用编辑距离计算文本相似度。
6、jaccard系数计算文本相似度。
7、文本角度(TF-IDF、LCS)。
8、HanLP。
9、基于gensim模块的中文句子相似度计算。
10、使用余弦计算,Simhash和Minhash两种算法
11、基于Google开源的BERT。
12、利用Google推出的深度学习框架TensorFlow基于CNN(卷积神经网络)、RNN(循环神经网络)、LSTM(长短期记忆模型)的若干算法和API构建文本分类、文本相似度计算和文本内容摘要。
13、MatchZoo。
14、计算文本的余弦相似度,基于tf-idf。
15、回译(效果比较好)、EDA(同义词替换、插入、交换和删除)(效果还行)、HMM-marko(质量较差)、syntax(依存句法、句法、语法书)(简单句还可)、seq2seq(深度学习同义句生成,效果不理想)。

猜你喜欢

转载自blog.csdn.net/qq_32447301/article/details/109038324
今日推荐