海外旅行に向けて準備 ~chatGPTとともに~


初めに

今回は、海外旅行への準備として、実際にレストランで利用される英会話のシーンを身につけるための教材作りをしてみましょう。
今回利用するのは以下の2つ

・chatGPT
・elevanlabs

この2つを使えばあなたも簡単にリスニング教材を作れます!
使い方さえ変えれば試験問題だってお手のもの

リンク

実際に今回の教材作りに利用しているgoogle colabのノートブックと、それに簡単な解説をつけたgithubのリンクを載せておきます。

notebook

github

解説

1. スクリプトの作成

chatgptに対して以下のようなpromptを投げかける

海外旅行に行った際、レストランでの注文のシーンを英語で再現してください。
以下の条件を含んでください。
・おすすめの料理を聞く
・会計はどうすればいいか
・最後にこの辺りで行ってみたほうがいい場所について聞く

これに対してのchatgptの返答

以下は、海外のレストランでの注文のシーンを英語で再現する例です。

場面: レストランでの注文

登場人物: あなた (Y) とウェイター (W)

シーン:

あなたがレストランに着き、テーブルに座りました。ウェイターがメニューを持ってきます。

Y: Good evening. Could you recommend any specialties of the house?

W: Of course! Our chef's specials tonight are the seafood paella and the grilled sirloin steak. They are both highly recommended.

Y: That sounds great. I'll go with the seafood paella, please. And may I have a glass of red wine to go with it?

W: Excellent choice! A glass of red wine with the seafood paella it is. Anything else for you?

Y: No, that should be it for now, thank you.

料理が提供され、あなたは美味しい食事を楽しんでいます。

W: (After the meal) How was your meal? Is there anything else I can get for you?

Y: The paella was delicious, thank you. Could you please bring the check?

W: Of course. I'll bring it right away.

ウェイターが会計を済ませ、お釣りを持ってきます。

W: Here's your check, sir. Is there anything else I can assist you with tonight?

Y: No, everything was perfect, thank you. By the way, are there any interesting places around here that you would recommend visiting?

W: Certainly! If you're interested in local history, there's a museum just a few blocks away, and the waterfront promenade is also quite beautiful in the evening.

Y: Thank you for the recommendations. I'll check those out.

W: You're welcome. Enjoy the rest of your evening!

あなたはウェイターに感謝の意を示し、レストランを後にします。

2. スクリプトのリスニング化

google colabで作業をします。詳しいところはnotebookのCreate Audio Scriptの項目を見てもらえると嬉しいですが、
コアスクリプトは以下の通り

# Docs.mdのDataPreparationを参照
# chatgptから会話内容を作成して、それぞれにまとめる
Y_list = [
    "Good evening. Could you recommend any specialties of the house?",
    "That sounds great. I'll go with the seafood paella, please. And may I have a glass of red wine to go with it?",
    "No, that should be it for now, thank you.",
    "The paella was delicious, thank you. Could you please bring the check?",
    "No, everything was perfect, thank you. By the way, are there any interesting places around here that you would recommend visiting?"
]

W_list = [
    "Of course! Our chef's specials tonight are the seafood paella and the grilled sirloin steak. They are both highly recommended.",
    "Excellent choice! A glass of red wine with the seafood paella it is. Anything else for you?",
     "How was your meal? Is there anything else I can get for you?",
    "Of course. I'll bring it right away.",
    "Certainly! If you're interested in local history, there's a museum just a few blocks away, and the waterfront promenade is also quite beautiful in the evening.",
    "You're welcome. Enjoy the rest of your evening!"
]

# ToDo: 年齢とか、性別とかそういう要素で判定できるようにする
Y_voice = "Clyde"
W_voice = "Rachel"

# concatenate audio
audios = []

for yl, wl in zip(Y_list, W_list):

  y_audio = generate(
    text=yl,
    voice=Y_voice,
    model="eleven_multilingual_v2"
  )
  w_audio = generate(
    text=wl,
    voice=W_voice,
    model="eleven_multilingual_v2"
  )

  audios.append(y_audio)
  audios.append(w_audio)

# display audio
sf = 44100
all_audio = audios[0]
for a in audios[1:]:
  all_audio += a
Audio(all_audio,rate=sf)

小技として、Y_listとW_listを作成する際にchatgptで以下のようなpromptを打つとやりやすくなります。

以下のような文章にあります。
あなたがレストランに着き、テーブルに座りました。ウェイターがメニューを持ってきます。

Y: Good evening. Could you recommend any specialties of the house?

W: Of course! Our chef's specials tonight are the seafood paella and the grilled sirloin steak. They are both highly recommended.

Y: That sounds great. I'll go with the seafood paella, please. And may I have a glass of red wine to go with it?

W: Excellent choice! A glass of red wine with the seafood paella it is. Anything else for you?

Y: No, that should be it for now, thank you.

料理が提供され、あなたは美味しい食事を楽しんでいます。

W: (After the meal) How was your meal? Is there anything else I can get for you?

Y: The paella was delicious, thank you. Could you please bring the check?

W: Of course. I'll bring it right away.

ウェイターが会計を済ませ、お釣りを持ってきます。

W: Here's your check, sir. Is there anything else I can assist you with tonight?

Y: No, everything was perfect, thank you. By the way, are there any interesting places around here that you would recommend visiting?

W: Certainly! If you're interested in local history, there's a museum just a few blocks away, and the waterfront promenade is also quite beautiful in the evening.

Y: Thank you for the recommendations. I'll check those out.

W: You're welcome. Enjoy the rest of your evening!

あなたはウェイターに感謝の意を示し、レストランを後にします。\ 以下の文章をYの英文のリストとWの英文のリストに並べ替えて出力してください。出力のフォーマットは以下です。
Y: [英文]
W: [英文]

出力

Y:

Good evening. Could you recommend any specialties of the house?
That sounds great. I'll go with the seafood paella, please. And may I have a glass of red wine to go with it?
No, that should be it for now, thank you.
The paella was delicious, thank you. Could you please bring the check?
No, everything was perfect, thank you. By the way, are there any interesting places around here that you would recommend visiting?

W:

Of course! Our chef's specials tonight are the seafood paella and the grilled sirloin steak. They are both highly recommended.
Excellent choice! A glass of red wine with the seafood paella it is. Anything else for you?
(After the meal) How was your meal? Is there anything else I can get for you?
Of course. I'll bring it right away.
Certainly! If you're interested in local history, there's a museum just a few blocks away, and the waterfront promenade is also quite beautiful in the evening.
You're welcome. Enjoy the rest of your evening!

また、elevanlabsはsignupしていない時の利用回数に制限あるので、制限なしで利用したい方は、signup or loginした後、以下のdocumentに従ってAPIをアクティベートしてください。

結果

普通のスピードの音声

ゆっくりな音声

おまけ

最後に問題作成に関するprompt

以下のような文章にあります。
あなたがレストランに着き、テーブルに座りました。ウェイターがメニューを持ってきます。

Y: Good evening. Could you recommend any specialties of the house?

W: Of course! Our chef's specials tonight are the seafood paella and the grilled sirloin steak. They are both highly recommended.

Y: That sounds great. I'll go with the seafood paella, please. And may I have a glass of red wine to go with it?

W: Excellent choice! A glass of red wine with the seafood paella it is. Anything else for you?

Y: No, that should be it for now, thank you.

料理が提供され、あなたは美味しい食事を楽しんでいます。

W: (After the meal) How was your meal? Is there anything else I can get for you?

Y: The paella was delicious, thank you. Could you please bring the check?

W: Of course. I'll bring it right away.

ウェイターが会計を済ませ、お釣りを持ってきます。

W: Here's your check, sir. Is there anything else I can assist you with tonight?

Y: No, everything was perfect, thank you. By the way, are there any interesting places around here that you would recommend visiting?

W: Certainly! If you're interested in local history, there's a museum just a few blocks away, and the waterfront promenade is also quite beautiful in the evening.

Y: Thank you for the recommendations. I'll check those out.

W: You're welcome. Enjoy the rest of your evening!

あなたはウェイターに感謝の意を示し、レストランを後にします。

上記の英語のスクリプトをもとに大学入試で出されるような4択の選択問題を5問作成してください。また答え・解説も作成してください。

こんな感じで打ち込むと出力はこんな感じ

以下は、上記の英語のスクリプトを元にした5つの選択問題です。各問題には答えと解説も含まれています。

問題 1:
ウェイターが料理を提供した後、どのような質問をしましたか?

A) "What time does the restaurant close?"
B) "Is there a vegetarian option?"
C) "How was your meal?"
D) "Do you have any specials tonight?"

答え 1: C) "How was your meal?"

解説 1: ウェイターは料理を提供した後に、食事の感想を尋ねました。

問題 2:
Y(あなた)が食事を注文する際、どの料理を選びましたか?

A) Grilled sirloin steak
B) Vegetable stir-fry
C) Seafood paella
D) Chicken Caesar salad

答え 2: C) Seafood paella

解説 2: Yは海鮮パエリアを選びました。

問題 3:
ウェイターは、Y(あなた)のパエリアに何を提供することになりましたか?

A) White wine
B) Sparkling water
C) Red wine
D) Orange juice

答え 3: C) Red wine

解説 3: ウェイターはパエリアに赤ワインを提供しました。

問題 4:
Y(あなた)が支払いをする際、どの質問をしましたか?

A) "What's the chef's special tonight?"
B) "Is there a discount for the meal?"
C) "Could you please bring the check?"
D) "Do you accept credit cards?"

答え 4: C) "Could you please bring the check?"

解説 4: Yは支払いをするためにウェイターにチェックを頼みました。

問題 5:
最後に、Y(あなた)はウェイターに何を尋ねましたか?

A) "Can you recommend any interesting places to visit around here?"
B) "What time does the museum close?"
C) "Do you have a loyalty program for frequent customers?"
D) "Can I get a discount on my next meal?"

答え 5: A) "Can you recommend any interesting places to visit around here?"

解説 5: 最後に、Yはウェイターに観光スポットを尋ねました。

うん、なかなかいい感じですね。chatgptのロングコンテキストとかgpt4に課金している人はもっと長いスクリプトでも同じことができると思うので試してみてください。

感想

今回は海外旅行の準備ということでchatgptとelevenlabsを利用して海外旅行英会話リスニング教材の作成の仕方を説明してみました。応用すれば、TOEICなどの練習、大学受験や高校受験の演習問題作成など幅広いです。ぜひみなさんも試してみてください。

この記事が気に入ったらサポートをしてみませんか?