如何训练ML模型将文本转换为代码

发布于 2025-02-09 18:30:14 字数 163 浏览 1 评论 0 原文

寻找一个有效的示例COLAB/笔记本,以显示能够转换“短文本”的文本生成模型的培训或微调 - > “编程代码文本”。

我正在学习这个主题,并希望通过一些公共GitHub存储库进行定制指标对其进行微调。

到目前为止,我发现的只是“继续句子”或简单地从蓝色生成文本的模型。非常感谢!

Looking for a working example Colab/Notebook showing training or fine-tuning of a text generation model capable of converting "short text" -> "programming code text".

I'm learning the topic and would like to fine-tune it with a custom metric on some public GitHub repos.

All I found so far are models that "continue a sentence" or simply generate the text out of the blue. Many thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半步萧音过轻尘 2025-02-16 18:30:14

首先,您可以看到 codexglue Microsoft/codexglue“ rel =“ nofollow noreferrer”>存储库,我们有四个类别:

  • 代码 - code(克隆检测,缺陷检测,披肩测试,代码完成,代码完成,代码修复和代码对代码修复和代码转换)
  • 文本-code(自然语言代码搜索,文本对代码生成)
  • 代码text(代码摘要)
  • Text-text(文档翻译)

您想要 文本对代码>“文本对代码生成”任务 codexglue 上的基本基准测试,此任务的最佳模型之一是 cotext cotext 支持以下编程语言:“ go”,“ java”,“ javascript”,“ php”,“ python”,“ ruby​​” 。您可以在预训练“ rel =” nofollow noreferrer“> huggingface”> huggingface 来自 在这里 并解释如何微调此 there there

First, You can see CodeXGLUE and their repository, we have four categories:

  • code-code (clone detection, defect detection, cloze test, code completion, code repair, and code-to-code translation)
  • text-code (natural language code search, text-to-code generation)
  • code-text (code summarization)
  • text-text (documentation translation)

You want text-to-code generation task. Base benchmark on CodeXGLUE, one of the best models for this task is CoTexT. CoTexT support these programming languages : "go" ,"java", "javascript", "php", "python", "ruby". You can find the pre-trained of this model on huggingface from here and explaining about how to fine-tune this here.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文