<p>I can think of a few ways for this to work, each could have varying degrees of difficulty in implementation.</p>

<hr>

<h2>Word Choice</h2>

<p>As @Marko mentioned in comments, Cantonese usually has a very different choice of word for common expressions. For example:</p>

<ul>
<li><a href="https://en.wiktionary.org/wiki/%E9%BB%9E#Etymology_2" rel="nofollow noreferrer">點</a>(trad.)/点(simp.) in Cantonese vs. 怎 in Mandarin</li>
<li><a href="https://en.wiktionary.org/wiki/%E9%82%8A#Etymology_2" rel="nofollow noreferrer">邊</a>/边 vs. 哪</li>
<li>係/系 vs. 是</li>
<li>唔 vs. 不</li>
<li>嘅 vs. 的</li>
<li>喺 vs. 在</li>
<li>咁 vs. 这么</li>
</ul>

<p>sentence-final particles:</p>

<ul>
<li>咯 (Cantonese only)</li>
<li>咩 (Cantonese only)</li>
<li>啫 (Cantonese only)</li>
<li><p>㗎 (Cantonese only)</p></li>
<li><p>吗 (Mandarin only)</p></li>
</ul>

<p>This will be easier to implement <strong>if the subtitle is an exact transcription</strong> of what's being said (I say this because sometimes they are not, instead, they are in written/more-Mandarin form). Frequency analysis of the appearance of these syllables could also be possible, I guess? <strong>Note</strong>: they work better on casual conversations than formal speeches or readings of written material.</p>

<p>This Wiktionary <a href="https://en.wiktionary.org/wiki/Category:Cantonese_language" rel="nofollow noreferrer">category page</a> could be a gem if you decide to use this approach, but not every entry in this category is Cantonese-specific.</p>

<hr>

<h2>Tones</h2>

<p>I'm thinking of a pitch analysis. And Cantonese has more tones - 9 in total - than their Mandarin counterpart - 5. If you can devise a way to count the total tones used in the audio, or to match each syllable to a tone and see which model fits best, it could be possible to tell the two apart.</p>

<hr>

<h2>Other phonetic features</h2>

<p>Other distinctions exist, to name a few:</p>

<ul>
<li>儿化(Erhua) in Mandarin (actually I'd not call them standard Mandarin, but northern Chinese dialect)</li>
<li>the -p, -t, -k, -m sound in Cantonese</li>
</ul>

<p>However, I'm not sure if/how you can detect them automatically.</p>

CC BY-SA 4.0
2020-03-18T17:02:37.537Z
2020-03-18T17:02:37.537Z
zypA13510
<p>For current task I need to create a solution how to detect if some video or audio of Chinese speech is  Mandarin or Cantonese (for now I do not need others dialects).  </p>

<p>For example, there is almost 100% solution to search for radio/TV in USA/Honk Kong or others locations where Cantonese is main dialect. Canada doesn't work due it has 50/50 for Mandarin/Cantonese. For Mandarin is simpler, just search sources from Mainland China.</p>

<p>But there is also another part - YouTube videos. I didn't find a way to detect dialect of speech in video. Auto-subtitles shows only text version which is in Simplified Chinese (written).</p>

<p>Also, there was an idea about searching for -p, -t or -k endings in speech (due Mandarin does not have them any more). I think it is quite good solution but not the best - others dialects have them too.</p>

<p>So my question is - Do you know or maybe have an idea how to detect Cantonese/Mandarin dialect in speech video automatically or using subtitles? 
Maybe there is a list of Mandarin/Cantonese only characters? </p>

CC BY-SA 4.0
2020-01-15T12:35:58.903Z
Write your own supervised learning machine learning algorithm on samples of audio data.
dROOOze
CC BY-SA 4.0
2020-01-15T12:40:37.353Z
@droooze this is an option, best one so far haha (even that it requests a lot of boring work), but I was wondering about some easiest way. And the best way to do it ask someone who actually know Chinese
Sova
CC BY-SA 4.0
2020-01-15T14:16:32.747Z
Detect dialect automatically  would be another exciting challenge for AI after it conquered Go.
Tang Ho
CC BY-SA 4.0
2020-01-17T06:40:29.203Z
If it's common speech, it's fairly easy, as the colloquialisms, common terms and sentence patterns do not overlap much. e.g. usage of 系 in Cantonese and 是 in Mandarin; 边度 in Cantonese vs 哪里/哪儿 in Mandarin; 儿化音 in Mandarin that simply does not exist in Cantonese; characters like 喇,咁,哂 etc in Cantonese which do not exist in Mandarin whatsoever; 不 in Mandarin vs 唔 in Cantonese; usage of English words with Chinese grammar e.g. "gua唔guarantee" in (HK-style) Cantonese vs 包不保证 in Mandarin, and so on and so forth. I hesitate to call them dialects, they really are much closer to different languages.
Marko
CC BY-SA 4.0
2020-04-18T02:36:43.307Z
@dROOOze I think machine learning would work. Here are some Mandarin sources on YouTube, [China Central TV - International Channel](https://www.youtube.com/channel/UCnAsZ46UTeFEgwOEwMezngQ), [China Central TV - Variety Show Channel](https://www.youtube.com/user/entcntv), [Hunan TV](https://www.youtube.com/user/imgotv), [Zhejiang TV](https://www.youtube.com/channel/UC52EYUUSlzcYqHj-qsx0RHg), [Shanghai TV](https://www.youtube.com/user/kankanews). Here are some Cantonese sources on YouTube, [TVB](https://www.youtube.com/user/tvb), [RTHK](https://www.youtube.com/channel/UC6of7UYhctnYmqABjUqzuxw).
Bósài
<mandarin><cantonese><topolect>
Is there any way to detect dialect automatically?
# Is there any way to detect dialect automatically?

(Asked by: username_0 on 2020-01-15)

For current task I need to create a solution how to detect if some video or audio of Chinese speech is Mandarin or Cantonese (for now I do not need others dialects).

For example, there is almost 100% solution to search for radio/TV in USA/Honk Kong or others locations where Cantonese is main dialect. Canada doesn't work due it has 50/50 for Mandarin/Cantonese. For Mandarin is simpler, just search sources from Mainland China.

But there is also another part - YouTube videos. I didn't find a way to detect dialect of speech in video. Auto-subtitles shows only text version which is in Simplified Chinese (written).

Also, there was an idea about searching for -p, -t or -k endings in speech (due Mandarin does not have them any more). I think it is quite good solution but not the best - others dialects have them too.

So my question is - Do you know or maybe have an idea how to detect Cantonese/Mandarin dialect in speech video automatically or using subtitles?
Maybe there is a list of Mandarin/Cantonese only characters?

**Tags:** mandarin, cantonese, topolect
> **Comments:**
> **username_1**: Write your own supervised learning machine learning algorithm on samples of audio data.  
> **username_0**: @droooze this is an option, best one so far haha (even that it requests a lot of boring work), but I was wondering about some easiest way. And the best way to do it ask someone who actually know Chinese  
> **username_2**: Detect dialect automatically  would be another exciting challenge for AI after it conquered Go.  
> **username_3**: If it's common speech, it's fairly easy, as the colloquialisms, common terms and sentence patterns do not overlap much. e.g. usage of 系 in Cantonese and 是 in Mandarin; 边度 in Cantonese vs 哪里/哪儿 in Mandarin; 儿化音 in Mandarin that simply does not exist in Cantonese; characters like 喇,咁,哂 etc in Cantonese which do not exist in Mandarin whatsoever; 不 in Mandarin vs 唔 in Cantonese; usage of English words with Chinese grammar e.g. "gua唔guarantee" in (HK-style) Cantonese vs 包不保证 in Mandarin, and so on and so forth. I hesitate to call them dialects, they really are much closer to different languages.  
> **username_4**: @dROOOze I think machine learning would work. Here are some Mandarin sources on YouTube, [China Central TV - International Channel](https://www.youtube.com/channel/UCnAsZ46UTeFEgwOEwMezngQ), [China Central TV - Variety Show Channel](https://www.youtube.com/user/entcntv), [Hunan TV](https://www.youtube.com/user/imgotv), [Zhejiang TV](https://www.youtube.com/channel/UC52EYUUSlzcYqHj-qsx0RHg), [Shanghai TV](https://www.youtube.com/user/kankanews). Here are some Cantonese sources on YouTube, [TVB](https://www.youtube.com/user/tvb), [RTHK](https://www.youtube.com/channel/UC6of7UYhctnYmqABjUqzuxw).  

---

## 1 answers

### Answer by username_5 on 2020-03-18. Score: 1

I can think of a few ways for this to work, each could have varying degrees of difficulty in implementation.

---

## Word Choice

As @Marko mentioned in comments, Cantonese usually has a very different choice of word for common expressions. For example:

* [點](https://en.wiktionary.org/wiki/%E9%BB%9E#Etymology_2)(trad.)/点(simp.) in Cantonese vs. 怎 in Mandarin
* [邊](https://en.wiktionary.org/wiki/%E9%82%8A#Etymology_2)/边 vs. 哪
* 係/系 vs. 是
* 唔 vs. 不
* 嘅 vs. 的
* 喺 vs. 在
* 咁 vs. 这么

sentence-final particles:

* 咯 (Cantonese only)
* 咩 (Cantonese only)
* 啫 (Cantonese only)
* 㗎 (Cantonese only)
* 吗 (Mandarin only)

This will be easier to implement **if the subtitle is an exact transcription** of what's being said (I say this because sometimes they are not, instead, they are in written/more-Mandarin form). Frequency analysis of the appearance of these syllables could also be possible, I guess? **Note**: they work better on casual conversations than formal speeches or readings of written material.

This Wiktionary [category page](https://en.wiktionary.org/wiki/Category:Cantonese_language) could be a gem if you decide to use this approach, but not every entry in this category is Cantonese-specific.

---

## Tones

I'm thinking of a pitch analysis. And Cantonese has more tones - 9 in total - than their Mandarin counterpart - 5. If you can devise a way to count the total tones used in the audio, or to match each syllable to a tone and see which model fits best, it could be possible to tell the two apart.

---

## Other phonetic features

Other distinctions exist, to name a few:

* 儿化(Erhua) in Mandarin (actually I'd not call them standard Mandarin, but northern Chinese dialect)
* the -p, -t, -k, -m sound in Cantonese

However, I'm not sure if/how you can detect them automatically.


---

