实测对比:Claude3在小项目编程中如何超越GPT-4

作者在帮助朋友开发小程序时,通过Claude3(基于Opus模型)实现了根据Excel表格中F列和H列内容修改图片文件名的需求。尽管起初GPT4未能满足全部需求,但Claude3的代码更为精准。文章还提到Claude3模型的强大和注册难度,以及推荐试用的网站。
摘要由CSDN通过智能技术生成

今天正好有个朋友找我帮忙,写个小程序,实现如下需求,

将一批图片文件按照excel中的格式进行文件名修改,原文件名要从excel中的F列获取,修改的文件名要从excel中的H列获取,大概就这么个需求,

我先将需求发给gp4,请看截图

gpt4解释得倒是很详细,可惜代码运行后不能没有达到需求。

这时,我想起了claude3,同样的需求我发给了claude3,(Opus模型,这个模型是最强大的).

不过它的代码,只改了我的第2行, 其他行没改,我继续问它

然后我运行它给的代码,这次运行正常了。下面是完整代码

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
using Excel = Microsoft.Office.Interop.Excel;

namespace foryutao
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            string excelFilePath = @"C:\temp\123.xlsx";
            string folderPath = @"C:\temp\123\";

            Excel.Application excelApp = new Excel.Application();
            Excel.Workbook workbook = excelApp.Workbooks.Open(excelFilePath);
            Excel.Worksheet worksheet = workbook.Sheets[1];

            try
            {
                int lastRow = worksheet.Cells.SpecialCells(Excel.XlCellType.xlCellTypeLastCell).Row;

                for (int i = 2; i <= lastRow; i++)
                {
                    string oldFileName = worksheet.Cells[i, 6].Value?.ToString();
                    string newFileName = worksheet.Cells[i, 8].Value?.ToString();

                    if (!string.IsNullOrEmpty(oldFileName) && !string.IsNullOrEmpty(newFileName))
                    {
                        string oldFilePath = Path.Combine(folderPath, oldFileName + ".jpg");
                        string newFilePath = Path.Combine(folderPath, newFileName + ".jpg");

                        if (File.Exists(oldFilePath))
                        {
                            File.Move(oldFilePath, newFilePath);
                        }
                    }
                }

                MessageBox.Show("文件重命名完成!");
            }
            catch (Exception ex)
            {
                MessageBox.Show("发生错误:" + ex.Message);
            }
            finally
            {
                workbook.Close();
                excelApp.Quit();
            }
        
        }
    }
}

程序运行界面如下:

点这个按钮就可以实现这个功能。

结论:如果只是写个小项目或者小程序的功能,目前看下来确实是claude3比gpt4更强大,其他方面还没做比较,另外目前claude3太难注册了,分享一个网站给朋友们试用一下:

https://chat.lmsys.org/

一定要选opus模型,claude3有三个模型,只有opus是最强大的。

  • 7
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

wuhanwhite

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值