php ml 使用_使用ML在朋友中找到最有趣的朋友

php ml 使用

A technical walkthrough of how to find the funniest Friend in FRIENDS

如何在朋友中找到最有趣的朋友的技术演练

After finishing Andrew Ng’s machine learning courses, I decided it was time to try a project of my own. Part of what I like about ML is how it can be applied to almost anything. With that in mind, I wanted to try a project that hadn’t been done before.

在完成了Andrew Ng的机器学习课程之后,我决定是时候尝试一个我自己的项目了。 我喜欢ML的部分原因是,它如何可以应用于几乎任何事物。 考虑到这一点,我想尝试一个以前没有做过的项目。

I settled on finding the funniest friend in FRIENDS because it seemed like an unanswered question and because it’s something that my non-technical friends might find interesting.

我决定在FRIENDS中找到最有趣的朋友,因为这似乎是一个悬而未决的问题,而且这是我的非技术朋友可能会发现的有趣问题。

In order to find the funniest friend in FRIENDS, we need to know which character generates the most laughter (per line). There are two caveats that I explain in the results article (which you should check out if you haven’t yet). The first is that we assume audience laughter (and length of laughter) maps to how funny a spoken line is. The second caveat is that we can’t capture purely non-verbal humor, which turns out to be ~3% of the show’s laughter (this is a rough calculation based on laughter’s proximity to spoken lines).

为了在朋友中找到最有趣的朋友,我们需要知道哪个角色产生最多的笑声(每行)。 我在结果文章中解释了两个注意事项(如果尚未查看,则应进行检查)。 首先,我们假设听众的笑声(和笑声的持续时间)与口语的趣味性相对应。 第二个警告是我们无法捕捉到纯粹的非语言幽默,而事实证明这大约是节目笑声的3%(这是根据笑声与口语线的接近程度进行的粗略计算)。

There are three main parts to figuring out which character is responsible for which laughter. First is identifying who is speaking and when. Second is identifying laughter and when it occurs. Third is piecing together the first two parts to figure out who is responsible for each instance of laughter.

弄清楚哪个角色导致哪个笑声是由三个主要部分组成的。 首先是确定谁在说话以及何时说话。 其次是识别笑声及其发生的时间。 第三是将前两个部分拼凑在一起,以确定每个笑声的肇事者。

第1部分 (Part 1)

谁与何时 (The Who and the When)

I talked the project over with some friends who know more about ML than I do. They advised me that the first part of the project (who is speaking when) is non-trivial when it comes to voice recognition algorithms. Detecting and differentiating human voices is still a difficult problem for ML. I read some papers and articles and it seemed to confirm my friends’ sentiments. Here is an example of an article that can identify different human voices with 80–85% accuracy. For my project, I didn’t think 80–85% accuracy would be high enough to draw any sort of conclusions about the funniest friend. That said, if you know of a relevant model for this sort of task please reach out!

我与一些比我更了解ML的朋友讨论了该项目。 他们告诉我,在语音识别算法方面,项目的第一部分(何时发言)是不平凡的。 对于ML,检测和区分人的声音仍然是一个难题。 我读了一些论文和文章,似乎证实了我朋友的观点。 是一篇文章示例,可以识别80-85%的不同人声。 对于我的项目,我认为80-85%的准确性不足以得出关于这个最有趣的朋友的任何结论。 也就是说,如果您知道此类任务的相关模型,请联系!

With voice recognition ML not likely to perform accurately enough, I decided to try some different approaches. Because FRIENDS is so popular, there are fan-created script files for every episode in the show. These script files tell you who is speaking and what they say:

由于语音识别ML不太可能表现得足够准确,因此我决定尝试一些不同的方法。 由于FRIENDS非常受欢迎,因此该节目中的每一集都有粉丝创建的脚本文件 。 这些脚本文件告诉您谁在讲话以及他们说什么:

Image for post

There have even been some data science articles written that make use of this script dataset in order to find interesting facts like who had the most speaking lines across all 10 seasons of the show.

甚至有一些数据科学文章都利用此脚本数据集来发现有趣的事实,例如谁在节目的所有10个季节中演讲最多。

These script files are great but they don’t tell us exactly WHEN any of these lines are said during the episode. Luckily, there are also subtitles files for each episode of the show. They tell you what is said and when it is said, but not WHO said it:

这些脚本文件很棒,但是在情节中什么时候说出这些内容时,它们并不能准确告诉我们。 幸运的是,节目的每一集都有字幕文件。 他们告诉您说了什么,说了什么,但世卫组织却没有说:

Image for post

If we could somehow combine the script file and subtitles file, we could get the WHO and the WHEN that we need in order to figure out who speaks right before laughter. The script and subtitles both contain the WHAT (the spoken lines) so we can join them together using the WHAT to map the WHO to the WHEN.

如果我们能够以某种方式将脚本文件和字幕文件结合在一起,我们可以得到我们所需要的WHO和WHEN,以便弄清楚谁在笑声之前会说话。 脚本和字幕都包含WHAT(口语行),因此我们可以使用WHAT将它们结合在一起,以将WHO映射到WHEN。

If you look closely at the script and subtitles images above, you can see that mapping the lines to each other won’t be as easy as it sounds.

如果仔细看一下上面的脚本和字幕图片,您会发现,将各行相互映射并不像听起来那样容易。

Quick note: There is a lot of code in this project so I don’t post much of it in this article. Instead I will point you to the relevant Jupyter notebook on Gith

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值