avatarRohit Madan

Free AI web copilot to create summaries, insights and extended knowledge, download it at here

2994

Abstract

ased after Ta Lo, and dueled with his future wife, Ying Li. Cut to Li telling this story to her son, young Shang-Chi, as she gifts him a jade necklace.</p><p id="c645">Then we cut to present-day, grown-up Shang-Chi — and the backstory ends.</p><h1 id="af52">Dole out the rest in smaller nuggets</h1><p id="833c">Those scenes were the essential backstory. The screenwriters will save the other parts — the non-essential backstory — for later.</p><p id="00e6">From here, the flashbacks get shorter and far more intermittent, only called upon when absolutely needed. In contrast to the 10 minute opening block of backstory, these later flashbacks are only 1–3 minutes long, and expertly woven into the main storyline.</p><p id="c275">This is where the magic of this strategy starts. Once you’re able to break up the backstory, you can dole them out later in much smaller sips. This way, the audience can truly savor the individual scene’s emotional flavors, rather than get so stuffed upfront that they can’t enjoy the main meal of your story!</p><p id="8086">You can even <b>turn these non-essential flashbacks into a mystery</b>.</p><p id="ee6d">For example, we know Shang-Chi’s mother died, but we don’t see how or when that happened until much later in the story. By first showing the aftermath of an event (Wenwu’s desire to bring his deceased wife back to life), then withholding the flashback that explains how the event occurred until much later (Li fighting the gang), the screenwriters were able to add a layer of mystery to the story without much effort.</p><figure id="4df9"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*oWh0Gp-3GPsLDaoibkSTHw.jpeg"><figcaption>Courtesy of Marvel Studios</figcaption></figure><p id="2265">A great example of this is in Act 3, when Shang-Chi tells Katy, on the eve of Wenwu’s arrival at Ta Lo, that he knows what he must do. We flashback to the aftermath of his mother’s death. His father takes 7-year-old Shang-Chi to a gambling den to identify the man responsible, and kills him right in front of his son. He then asks the scared little boy if he’ll help his father avenge his mother’s murder.</p><p id="bee4">That was the day Wenwu took his son’s life away, and turned him into a killing machine. Coming out of that flashback, Shang-Chi admits that he <i>did</i> carry out his father’s kill order, at just 14 years old. It’s time to finally stop this man who’d destroyed his life, was responsible for killing his mother — and for the destruction he’s about to lay upon Ta Lo.</p><p id="6579">The screenwriters could’ve easily told the entire backstory of how his mother died all at once: starting with the gang of men who show up at the Xu family’s door, how Li says her final words to her young son, Shang-Chi hiding while watching out the window, how Wenwu comes home only to discover the boy crying over his mother’s dead body, and Wenwu taking the boy to the gambling den and asking him to help avenge his mother’s death.</p><

Options

p id="7f7d">Yet every single one of these scenes were shown separately, at different intervals, spread out throughout the movie. The writers knew that each flashback had the ability to elicit different emotions, depending on how much they contrasted or complemented the current storyline they were woven into.</p><h1 id="9724">Unlocking emotional value</h1><p id="e9af">Such strategic placing of flashbacks would also be key in helping the audience understand what a character was thinking or feeling, and their internal motivations that the characters themselves would never say out loud.</p><figure id="e9c3"><img src="https://cdn-images-1.readmedium.com/v2/resize:fit:800/1*QVAY3ltDtXVsdqdX7k8hPQ.jpeg"><figcaption>Courtesy of Marvel Studios</figcaption></figure><p id="087b">A great example of this, was after Shang-Chi and his father’s first battle in Ta Lo. Seemingly defeated, Shang-Chi falls into the lake. As he sinks deeper and deeper, we flashback to the final words his mother says to his younger self, right before she sends him away to face the gang (and her doom): “I’m so proud of you. Our family needs you.”</p><p id="eaeb">This is what wakes Shang-Chi up, and what gives him the strength to ride that dragon back up out of the water and into battle. If that flashback had been shown at any other moment, it would not have resonated nearly as much as it did in <i>that</i> scene, in <i>that</i> specific moment, when Shang-Chi clearly needed the biggest inspirational boost of his life.</p><p id="542c">That’s the emotional power flashbacks can give you, if you know how to string them out and use only when absolutely necessary to complement the main story!</p><p id="1297"><i>For more of my movie/TV storytelling tips, check out my 2nd in this series:</i></p><div id="12cb" class="link-block"> <a href="https://readmedium.com/shang-chi-story-analysis-2-best-vs-worst-scenes-masterclass-dd8b414059ba"> <div> <div> <h2>Shang-Chi Analysis #2: Best vs. Worst Scenes Masterclass</h2> <div><h3>How did the writers construct the best scene of the movie, and what fatal mistake led to the worst scene?</h3></div> <div><p>medium.com</p></div> </div> <div> <div style="background-image: url(https://miro.readmedium.com/v2/resize:fit:320/1*OxTI7nG-xwHx_aO8ZhJOBQ.jpeg)"></div> </div> </div> </a> </div><p id="9f11"><b><i>Dancy Fu</i></b><i> is a writer and learning experience designer. She has been analyzing movies, TV shows, novels and screenplays for more than 16 years, collecting storytelling insights to improve her own writing and <a href="https://courses.philanthropyu.org/courses/course-v1:PhilanthropyU+Storytelling_000+1_1.37_20191118_20191229/about">online courses (on what else, storytelling</a>! :) Dancy has lived in 8 different cities, and currently calls Los Angeles home.</i></p></article></body>

Bag of words code — The easiest explanation of NLP technique using a python

Aloha my fellow passengers, (Skip to end for the code )

Today I am going to explain Bag of words technique to you.

If you’re here, you probably know why we use it but if you do not know then I’ll tell you with an example.

Explain Bag of Words with an example?

Go to your gmail, open priority inbox and see google magic up your inbox by categorizing Important, Social, spam etc of your all emails.

Remember now?

How does google know some mails are important to you while other’s aren’t ?

Although many factors come in to play, one prime factor is a machine reads your mails and then understands what’s important to you, and then shows it to you, Voila.

The catch is, machine’s do not know what is English , it only understands numbers and so what it does is that it breaks all your documents into words, something like -

Email

Hi Mr Madan,

Congratulations, I loved your article as it was able to explain to me what bag of words does in a simple manner.

How machine breaks it

Hi, Mr, Madan, Congratulations, I,loved, your, article …………in, a , simple , manner.

This splitting of words is then -

  1. Cleaned or preprocessed — Remove all unnecessary special characters, if there are words of other accent like Polish, German, spanish etc. remove or replace them or add the right unicode to make them readable for machine.
  2. Normalize all data — Using .lower() function remove any capital letter words from the data.
  3. Lamentization and steming — Remove all adjectives/build on words from data i.e. Baked, baking, baker are all build on words over bake. Categorising all such words from data to the root word. Also, removing all stop words i.e. all words that add no meaning or dimension to the feature such as a, the, etc.

Next once we have all words, we tokenise it i.e. write count of repetition of all words in our document. Ex — This cat is a fat cat that is cute >> This, cat , is , a , fat , cat , that , is , cute >>> This — 1 , cat — 2 , is -2 , a -1 , fat — 1 , that -1 , cute — 1

or

This — 1

cat — 2

is -2

a — 1

fat — 1

that -1

cute — 1

This process is called tokenization.

Before we understand what is next to do, I will tell you why are we doing all this.

The goal is to find features or words in this case in a document that can help us provide either some meaning from the document or provide some help in comparing with similar non similar documents.

Breaking down the tokenized words of Document 1 help us compare it to other tokenized words of Document 2, hence help in finding similar documents.

Now back to bag of words.

After tokenization, we move to building vocabulary or finding features from the documents.

vocab = All final features after cleaning, removing stop words etc.

So if a document has 3 documents and each document has 7 words, a vocab is the best choice of words from the document which say is 10 words out of 21 words in our case.

Vocab count = count of all unique features or words which is 10 for us (Say).

After we find the vocab, we convert the words we finalized into vectors, how you ask ?

Say our vocab for “This cat is a fat cat that is cute” is

Cat — 2

is — 2

Fat — 1

Cute — 1

vocab count = 4

So vector of document “This cat is a fat cat that is cute” is

[022010001]

This number is nothing but a representation when you compare final vocab vs words in document i.e. upon comparing

This — 1 , cat — 2 , is -2 , a -1 , fat — 1 , that -1 , cute — 1

and Cat — 2, is — 2, Fat — 1, Cute — 1

We get [022010001]

This process is called vectorization.

Tada, these are all concepts of Bags of words, so now like I promised, I am sharing my code with you which is based upon sklearn, if you want to see how each process works via code, check this.

#Part 1 Declaring all documents and assigning to a document document1=”This is my code on bag of words.” document2=”Bag of words is a NLP technique.” document3=”I will explain it to you in a simple way”

#Part 2 — Importing libraries and intializing CountVectorizer

from sklearn.feature_extraction.text import CountVectorizer

#Making a list or Document from all documents Doc=[document1,document2,document3]

#Initializing CountVectorizer from sklearn vectorizer = CountVectorizer(stop_words=’english’)

#Part 3 — Getting feature names of final words that we will use to tag this document

X = vectorizer.fit_transform(Doc)

analyze = vectorizer.build_analyzer()

analyze(document1)

analyze(document2)

analyze(document3)

vectorizer.transform(document1).toarray()

vectorizer.transform(document2).toarray()

vectorizer.transform(document3).toarray()

print(vectorizer.get_feature_names())

Output>>>[‘bag’, ‘code’, ‘explain’, ‘nlp’, ‘simple’, ‘technique’, ‘way’, ‘words’]

#Part 4 — Vectorizing or creating a matrix of all three documents

print(X.toarray())

Output>>> [[1 1 0 0 0 0 0 1] [1 0 0 1 0 1 0 1] [0 0 1 0 1 0 1 0]]

Or

Go checkout my Github here > Check Bag of words code.

I hope this was simple and helps you understand the concept, if you have feedback that can help me improve content or code, write to me — [email protected]

Peace.

Machine Learning
Bag Of Words
NLP
Easy
Code
Recommended from ReadMedium