Skip to content

Commit

Permalink
pos exercise link
Browse files Browse the repository at this point in the history
  • Loading branch information
codebasics committed May 11, 2022
1 parent b0e3f64 commit 80eb297
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 173 deletions.
178 changes: 7 additions & 171 deletions 7_pos/part_of_speech_in_spacy.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@
},
{
"cell_type": "code",
"execution_count": 45,
"metadata": {},
"execution_count": 50,
"metadata": {
"scrolled": false
},
"outputs": [
{
"data": {
Expand All @@ -236,182 +238,16 @@
" results,\n",
" for,\n",
" the,\n",
" quarter,\n",
" ended,\n",
" December,\n",
" 31,\n",
" 2021,\n",
" as,\n",
" compared,\n",
" to,\n",
" the,\n",
" corresponding,\n",
" period,\n",
" of,\n",
" last,\n",
" fiscal,\n",
" year,\n",
" Revenue,\n",
" was,\n",
" $,\n",
" 51.7,\n",
" billion,\n",
" and,\n",
" increased,\n",
" 20,\n",
" %,\n",
" Operating,\n",
" income,\n",
" was,\n",
" $,\n",
" 22.2,\n",
" billion,\n",
" and,\n",
" increased,\n",
" 24,\n",
" %,\n",
" Net,\n",
" income,\n",
" was,\n",
" $,\n",
" 18.8,\n",
" billion,\n",
" and,\n",
" increased,\n",
" 21,\n",
" %,\n",
" Diluted,\n",
" earnings,\n",
" per,\n",
" share,\n",
" was,\n",
" $,\n",
" 2.48,\n",
" and,\n",
" increased,\n",
" 22,\n",
" %,\n",
" Digital,\n",
" technology,\n",
" is,\n",
" the,\n",
" most,\n",
" malleable,\n",
" resource,\n",
" at,\n",
" the,\n",
" world,\n",
" ’s,\n",
" disposal,\n",
" to,\n",
" overcome,\n",
" constraints,\n",
" and,\n",
" reimagine,\n",
" everyday,\n",
" work,\n",
" and,\n",
" life,\n",
" said,\n",
" Satya,\n",
" Nadella,\n",
" chairman,\n",
" and,\n",
" chief,\n",
" executive,\n",
" officer,\n",
" of,\n",
" Microsoft,\n",
" As,\n",
" tech,\n",
" as,\n",
" a,\n",
" percentage,\n",
" of,\n",
" global,\n",
" GDP,\n",
" continues,\n",
" to,\n",
" increase,\n",
" we,\n",
" are,\n",
" innovating,\n",
" and,\n",
" investing,\n",
" across,\n",
" diverse,\n",
" and,\n",
" growing,\n",
" markets,\n",
" with,\n",
" a,\n",
" common,\n",
" underlying,\n",
" technology,\n",
" stack,\n",
" and,\n",
" an,\n",
" operating,\n",
" model,\n",
" that,\n",
" reinforces,\n",
" a,\n",
" common,\n",
" strategy,\n",
" culture,\n",
" and,\n",
" sense,\n",
" of,\n",
" purpose,\n",
" Solid,\n",
" commercial,\n",
" execution,\n",
" represented,\n",
" by,\n",
" strong,\n",
" bookings,\n",
" growth,\n",
" driven,\n",
" by,\n",
" long,\n",
" term,\n",
" Azure,\n",
" commitments,\n",
" increased,\n",
" Microsoft,\n",
" Cloud,\n",
" revenue,\n",
" to,\n",
" $,\n",
" 22.1,\n",
" billion,\n",
" up,\n",
" 32,\n",
" %,\n",
" year,\n",
" over,\n",
" year,\n",
" said,\n",
" Amy,\n",
" Hood,\n",
" executive,\n",
" vice,\n",
" president,\n",
" and,\n",
" chief,\n",
" financial,\n",
" officer,\n",
" of,\n",
" Microsoft]"
" quarter]"
]
},
"execution_count": 45,
"execution_count": 50,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"filtered_tokens"
"filtered_tokens[:10]"
]
},
{
Expand Down
4 changes: 2 additions & 2 deletions 7_pos/pos_exercise.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Exercise for Spacy POS tutorial,

1) You are parsing a news story from cnbc.com. News story is stores in [news_story.txt]() which is available in this same folder on github. You need to,
1) You are parsing a news story from cnbc.com. News story is stores in [news_story.txt](https://github.com/codebasics/nlp-tutorials/blob/main/7_pos/news_story.txt) which is available in this same folder on github. You need to,
1) Extract all NOUN tokens from this story. You will have to read the file in python first to collect all the text and then extract NOUNs in a python list
2) Extract all numbers (NUM POS type) in a python list
3) Print a count of all POS tags in this story

[Solution]()
[Solution](https://github.com/codebasics/nlp-tutorials/blob/main/7_pos/Exercise/pos_exercise_solution.ipynb)

0 comments on commit 80eb297

Please sign in to comment.