Bootstrap

学术ChatGPT——利用ChatGPT助力日常工作与学习

ChatGPT的出现给各个行业带来了前所未有的冲击,其中也包括学术研究领域。在学术研究领域,有着「数学天才」之称陶哲轩之前就曾表示,他已经将ChatGPT纳入了自己的工作流程。

那么做为一名普通的工作或者学习的人员,如何使用ChatGPT帮忙我们日常撰写论文,编写学术报告,读懂算法源码等?体验网址:山东可立 (klaisys.com) 。

一、论文开题资料搜索

在研究问题的初期,往往都是要查阅很多资料和该主题之前有代表性的论文,这是一个繁琐的工作,但现在可以交给ChatGPT,ChatGPT可以帮助研究人员快速获取相关文献和资料,研究人员只需要输入一个问题或者关键词,ChatGPT就可以帮助他们搜索相关的文献和资料,根据这些论文的整体脉络,我们大致可以对相关领域有大概了解。

比如我们要找图像修复的相关论文,它会列这几年关于深度学习图像修复的相关论文,

二、中文学术润色

在论文处理方面,ChatGPT能够自动检测和纠正文章中的语法错误、语句不流畅、标点符号错误等问题,同时还能够提供更加准确、流畅、自然的表达方式,使文章更加易读易懂。对于一个不擅长写作的人来讲,好不容易肝出来的几百个字,但什么看都觉得结构错乱,论点不清晰、连贯,边熬夜边在心中默念翟天临改完的人来讲,ChatGPT无疑是一个不错的助手。

三.英文学术处理

1.语句润色

对于非英语母语的科研人员来说,写作时常使用一些口语化的表达方式。比如,在学术文章中,应该避免使用口语化的表达方式,例如“cool”、“awesome”等。这些词汇在口语中很常见,但在学术文章中显得不够正式和专业。相反,应该使用更加正式和专业的词汇,例如“remarkable”、“impressive”等。这些语句在不是学术类文章里面可能影响不是很大,但在学术类文章里不仅会影响文章的可读性和专业性,还会降低读者对作者的信任度。

比如我对实验结果只会写:

What an amazing result this is, this implementation is amazing.

但交给ChatGPT后,它给的润色后的效果:

The implementation of this project is truly remarkable. The level of detail and precision that has gone into every aspect of it is truly impressive. From the planning stages to the final execution, every step has been carefully thought out and executed with the utmost care and attention to detail.

The end result is nothing short of amazing. The project has exceeded all expectations and has delivered a product that is not only functional but also aesthetically pleasing. The attention to detail is evident in every aspect of the project, from the design to the functionality.

It is clear that a lot of hard work and dedication has gone into this project. The team responsible for its implementation should be commended for their efforts. They have truly created something special that will be appreciated by many for years to come.

In conclusion, this implementation is truly amazing. It is a testament to the hard work and dedication of the team responsible for its creation. It is a shining example of what can be achieved when people work together towards a common goal. Well done to all involved!

2.英语语法查错

在写作时常会犯一些常见的语法错误。这些错误不仅会影响文章的可读性和专业性,还会降低读者对作者的信任度。我们还可以让ChatGPT来帮我们检查一些常见的语法错误:

四、中英互译

1.中译英

在学术研究中,中文译成英语的难点主要在于学术专用词汇的翻译。这些词汇往往是中文特有的,而在英语中没有对应的词汇或者对应的词汇含义不完全相同。

梁启超认为,国学应该包括社会实践和读书两个方面,而且社会实践要比读书更重。孔子曾说: “先行而后言”,“行有余力,则以学文”。常言说:“百无一用是书生”,只会读书不会思考的是书呆 子。“新国学”注重实践性。“新国学”是每个人身体力行的事情,是以个人生活和社会实践为目的,个人 应该为解决现实问题而读书。马克思说:“实践是检验真理的唯一标准。”用在读书上可以说实践是目的, 是检验读书效果的方法。朱熹曾说做学问有三个方面:分别是讲明义理、以修其身、推以及人,即“明义 理,修其身,为世政。”明理是修身和为世政的前提,明理就要读书。新国学更是注重实践性。

这是GPT给出的翻译结果:

Liang Qichao believed that Chinese traditional culture should include both social practice and reading, and social practice is more important than reading. Confucius once said, "Action comes first, then words," and "If you have extra energy after action, then study literature." It is often said that "bookworms are useless," and those who only know how to read but not how to think are bookish. "New National Studies" emphasizes practicality. "New National Studies" is something that everyone should practice in their daily lives and social practices, and individuals should read books to solve real problems. Marx said, "Practice is the sole criterion for testing truth." Applied to reading, practice is the goal and the method for testing the effectiveness of reading. Zhu Xi once said that there are three aspects to learning: explaining principles, cultivating oneself, and benefiting society, which means "explaining principles, cultivating oneself, and governing the world." Understanding principles is the prerequisite for cultivating oneself and governing the world, and understanding principles requires reading. "New National Studies" emphasizes practicality even more.

这是某专业翻译APP给出的结果:

According to Liang Qichao, Sinology should include both social practice and reading, and social practice is more important than reading. Confucius once said, "Speak first and then speak." "If you have the power to do something, you should study literature." As the saying goes: "nothing is a scholar", can only read will not think is a nerd. "New Sinology" pays attention to practice. "New Guoxue" is something that every person physically does. It is for the purpose of personal life and social practice. Individuals should read books to solve practical problems. Marx said, "Practice is the sole criterion for testing truth." In reading can be said that practice is the purpose, is to test the effect of reading methods. Ming reason is the premise of self-cultivation and world politics, Ming reason is to read. The new sinology pays more attention to practice.

2.英译中

英文:

In stage 2 (Fig. 2), we employ the large MeIn3D database[7] which includes nearly 10,000 3D face images, and we utilize the Wh,f regression matrix to construct new full head shapes that we later combine with the real facial scans.We achieve this by discarding the facial region of the the full head instance which has less detailed information and we replace it with the registered LSFM face of the MeIn3D scan. In order to create a unique instance we merge the meshes together by applying a NICP framework, where we deform only the outer parts of the facial mesh to match with the cranium angle and shape so that the result is a smooth combination of the two meshes. Following the formulation in [13], this is accomplished by introducing higher stiffness weights in the inner mesh (lower on the outside) while we apply the NICP algorithm. To compute those weights we measure the Euclidean distance of a given point from the nose tip of the mesh and we assign a relative weight to that point. The bigger the distance from the nose tip, the smaller the weight of the point. One of the drawbacks of the LYHM is the arbitrary neck circumference, where the neck tends to get broader when the general shape of the head increases. In stage 3 (Fig. 2), we aim at excluding this factor from our final head model by applying a final NICP step between the merged meshes and our head template St. We utilized the same framework as before with the point-weighted strategy where we assign weights to the points based on their Euclidean distance from the center of the head mass. This helps us avoid any inconsistencies of the neck area that might appear from the regression scheme. For the area around the ear, we have introduced 50 additional landmarks to control the registration and preserve the general shape of the ear area.

GPT译成中文:

在第二阶段(图2),我们使用包含近10,000个3D面部图像的大型MeIn3D数据库[7],并利用Wh,f回归矩阵构建新的完整头部形状,然后将其与真实面部扫描组合。我们通过丢弃具有较少详细信息的完整头部实例的面部区域,并用MeIn3D扫描的已注册LSFM面部替换它来实现这一点。为了创建一个独特的实例,我们通过应用NICP框架将网格合并在一起,其中我们仅变形面部网格的外部部分以匹配颅骨的角度和形状,以便结果是两个网格的平滑组合。根据[13]中的公式,这是通过在应用NICP算法时在内部网格中引入更高的刚度权重来实现的(外部权重较低)。为了计算这些权重,我们测量给定点与网格鼻尖的欧几里得距离,并为该点分配相对权重。距离鼻尖越远,点的权重越小。 LYHM的一个缺点是任意的颈围,当头部的一般形状增加时,颈部往往会变得更宽。在第三阶段(图2)中,我们旨在通过在合并的网格和我们的头部模板St之间应用最终的NICP步骤来排除这个因素。我们使用了与之前相同的框架,采用基于点的加权策略,根据点与头部质量中心的欧几里得距离为点分配权重。这有助于我们避免由回归方案引起的颈部区域的任何不一致性。对于耳朵周围的区域,我们引入了50个额外的地标来控制配准并保留耳朵区域的一般形状。

这是某专业翻译APP给出的结果:

在第二阶段(图2),我们使用了大型MeIn3D数据库[7],其中包括近10,000张3D人脸图像,我们利用Wh,f回归矩阵构建新的完整头部形状,我们随后将其与真实的面部扫描相结合。我们通过丢弃完整头部实例的面部区域来实现这一点,该区域具有较少的详细信息,我们将其替换为MeIn3D扫描的注册LSFM面部。为了创建一个独特的实例,我们通过应用NICP框架将网格合并在一起,在那里我们只变形面部网格的外部部分,以匹配头盖骨的角度和形状,以便结果是两个网格的平滑组合。根据[13]中的公式,当我们应用NICP算法时,这是通过在内部网格中引入更高的刚度权重(在外部网格中引入更低的刚度权重)来实现的。为了计算这些权重,我们测量给定点到网格鼻尖的欧几里得距离,并为该点分配一个相对权重。离鼻尖的距离越大,鼻尖的重量越小。LYHM的缺点之一是任意的颈部围度,当头部的总体形状增加时,颈部往往会变得更宽。在第3阶段(图2),我们的目标是通过在合并网格和头部模板st之间应用最后的NICP步骤,将该因素从最终的头部模型中排除。我们使用与之前相同的框架,采用点加权策略,根据点与头部质量中心的欧几里得距离为点分配权重。这有助于我们避免回归方案中可能出现的颈部区域的任何不一致。对于耳朵周围的区域,我们引入了50个额外的地标来控制注册并保持耳朵区域的总体形状。

五、解释代码

程序员最讨厌的两件事:1. 写文档,2. 别人不写文档。写文档需要花费大量的时间和精力,而且很多程序员并不擅长写作,这让他们感到非常困难和烦恼。其次,写文档往往被认为是一项无聊的任务,因为它需要程序员去描述一些非常琐碎的细节,在程序员眼里,这些处理细节多看一眼就明白了。然而,尽管程序员讨厌写文档,但是他们同样讨厌别人不写文档。这是因为在一个团队中,文档是非常重要的,它可以帮助团队成员更好地理解代码和项目,从而提高工作效率和质量。如果有人不写文档,那么其他人就需要花费更多的时间和精力去理解代码和项目,这会让整个团队的工作效率受到影响。我们可以试着让ChatGPT帮我们做了这件事情。

这是一段C++的图像处理代码。

int getSignature(cv::Mat& cv_src, cv::Mat& cv_dst, cv::Scalar colour, cv::Size name_size, cv::Size image_size)
{
    int val = verify();
    if (val != 0)
    {
        return val;
    }

    if (cv_src.empty())
    {
        return  -20;
    }
    cv::Mat cv_resize;
    cv::resize(cv_src, cv_resize, cv::Size(1024, 1024));

    cv::Mat cv_edge, cv_gray, cv_blur;
    EdgesSubPixName(cv_resize, cv_edge);

    cv::blur(cv_edge, cv_blur, cv::Size(3, 3));
    cv::cvtColor(cv_blur, cv_gray, cv::COLOR_BGR2GRAY);

    cv::Mat cv_bin = cv_gray.clone();
    cv::threshold(cv_gray, cv_bin, 128, 255, cv::THRESH_OTSU | cv::THRESH_BINARY);

    cv::Mat cv_erode, cv_dilate;
    cv::Mat element_d = getStructuringElement(cv::MORPH_RECT, cv::Size(3, 3), cv::Point(-1, -1));
    cv::dilate(cv_bin, cv_dilate, element_d);

    cv::Mat element_e = getStructuringElement(cv::MORPH_RECT, name_size, cv::Point(-1, -1));
    cv::erode(cv_dilate, cv_erode, element_e);

    cv::Mat cv_bin_s;
    cv::resize(cv_erode, cv_bin_s, cv::Size(cv_src.cols, cv_src.rows));
    cv::Mat cv_name = cv::Mat(cv_src.size(), CV_8UC3, cv::Scalar(255, 255, 255));

    for (int row = 0; row < cv_src.rows; row++)
    {
        for (int col = 0; col < cv_src.cols; col++)
        {
            int pix = cv_bin_s.at<uchar>(row, col);
            if (pix <= 0)
            {
                cv_name.at<cv::Vec3b>(row, col)[0] = colour.val[0];
                cv_name.at<cv::Vec3b>(row, col)[1] = colour.val[1];
                cv_name.at<cv::Vec3b>(row, col)[2] = colour.val[2];
            }
        }
    }
    if (image_size.empty())
    {
        cv::resize(cv_name, cv_dst, cv_src.size());
    }
    else
    {
        cv::resize(cv_name, cv_dst, image_size);
    }

    return 0;
}

ChatGPT给出的解释文档:

该函数接受一个源图像(cv_src),并返回一个带有指定颜色(colour)和大小(name_size)的签名图像(cv_dst)。该函数首先检查源图像是否为空,如果不为空,则将其调整为1024x1024。然后,它对图像应用边缘检测、模糊和阈值处理,以获得二进制图像。然后,使用指定的结构元素对二进制图像进行膨胀和腐蚀形态学操作。最终得到的二进制图像被调整大小以匹配源图像,并用于创建签名图像,方法是将值小于或等于0的像素的颜色设置为指定的颜色。然后将签名图像调整大小以匹配源图像或调整为指定的图像大小(如果提供)。如果成功,则该函数返回0,否则返回错误代码。

这是一段python代码,是把json的文件格式改成yolo的txt格式:

def ChangeToYolo5(files, txt_Name):
    if not os.path.exists('tmp/'):
        os.makedirs('tmp/')
    list_file = open('tmp/%s.txt' % (txt_Name), 'w')
    for json_file_ in files:
        json_filename = labelme_path + json_file_ + ".json"
        imagePath = labelme_path + json_file_ + ".jpg"
        list_file.write('%s/%s\n' % (wd, imagePath))
        out_file = open('%s/%s.txt' % (labelme_path, json_file_), 'w')
        json_file = json.load(open(json_filename, "r", encoding="utf-8"))
        height, width, channels = cv2.imread(labelme_path + json_file_ + ".jpg").shape
        for multi in json_file["shapes"]:
            points = np.array(multi["points"])
            xmin = min(points[:, 0]) if min(points[:, 0]) > 0 else 0
            xmax = max(points[:, 0]) if max(points[:, 0]) > 0 else 0
            ymin = min(points[:, 1]) if min(points[:, 1]) > 0 else 0
            ymax = max(points[:, 1]) if max(points[:, 1]) > 0 else 0
            label = multi["label"]
            if xmax <= xmin:
                pass
            elif ymax <= ymin:
                pass
            else:
                cls_id = classes.index(label)
                b = (float(xmin), float(xmax), float(ymin), float(ymax))
                bb = convert((width, height), b)
                out_file.write(str(cls_id) + " " + " ".join([str(a) for a in bb]) + '\n')
                print(json_filename, xmin, ymin, xmax, ymax, cls_id)

这段代码定义了一个名为“ChangeToYolo5”的函数,它接受两个参数:“files”和“txt_Name”。它首先检查是否存在名为“tmp/”的目录,如果不存在则创建它。然后打开一个名为“tmp/{txt_Name}.txt”的文件,并将“files”中所有图像文件的路径写入其中。

对于“files”中的每个JSON文件,代码打开相应的图像文件并获取其高度、宽度和通道数。然后循环遍历JSON文件中的每个形状,并提取其标签和边界框坐标。如果边界框的宽度或高度为零或负数,则跳过该形状。否则,使用名为“classes”的列表将标签转换为整数类别ID,并使用名为“convert”的函数将边界框坐标转换为YOLO格式。将生成的类别ID和边界框坐标写入与JSON文件同名但扩展名为“.txt”的文本文件中。

最后,代码为每个形状打印一些调试信息,包括JSON文件名、边界框坐标和类别ID。

;