Skip to content

Commit

Permalink
add text presentation in doc/toc (force push)
Browse files Browse the repository at this point in the history
  • Loading branch information
ccxzhang committed Nov 1, 2023
1 parent 6f4c337 commit 46644be
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 57 deletions.
2 changes: 2 additions & 0 deletions docs/_toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ parts:
- caption: Text
chapters:
- file: text/intro
- url: https://worldbank.github.io/pacific-observatory/interactive/text/text_presentation.slides
title: Text Presentation
- caption: Automatic Identification System
chapters:
- file: ais_intro
Expand Down
10 changes: 5 additions & 5 deletions docs/images/interactive/text/text_presentation.slides.html
Original file line number Diff line number Diff line change
Expand Up @@ -7664,7 +7664,7 @@ <h2 id="Topic-Modeling">Topic Modeling<a class="anchor-link" href="#Topic-Modeli
</div>
<div class="jp-InputArea jp-Cell-inputArea"><div class="jp-InputPrompt jp-InputArea-prompt">
</div><div class="jp-RenderedHTMLCommon jp-RenderedMarkdown jp-MarkdownOutput" data-mime-type="text/markdown">
<h2 id="Sentimental-Analysis">Sentimental Analysis<a class="anchor-link" href="#Sentimental-Analysis">¶</a></h2>
<h2 id="Sentiment-Analysis">Sentiment Analysis<a class="anchor-link" href="#Sentiment-Analysis">¶</a></h2>
</div>
</div>
</div>
Expand Down Expand Up @@ -7727,7 +7727,7 @@ <h2 id="Sentimental-Analysis">Sentimental Analysis<a class="anchor-link" href="#
</div>
</div>
</div></section><section>
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=5c6f09db">
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=ebfaa60c">
<div class="jp-Cell-inputWrapper" tabindex="0">
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
</div>
Expand Down Expand Up @@ -7764,7 +7764,7 @@ <h2 id="Sentimental-Analysis">Sentimental Analysis<a class="anchor-link" href="#
</div>
</div>
</div></div></section><section>
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=56ec029f">
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=5f313f26">
<div class="jp-Cell-inputWrapper" tabindex="0">
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
</div>
Expand All @@ -7774,7 +7774,7 @@ <h2 id="Sentimental-Analysis">Sentimental Analysis<a class="anchor-link" href="#
</div>
</div>
</div>
</div><div class="fragment"><div class="jp-Cell jp-CodeCell jp-Notebook-cell" id="cell-id=e739223b">
</div><div class="fragment"><div class="jp-Cell jp-CodeCell jp-Notebook-cell" id="cell-id=3f8eb6a8">
<div class="jp-Cell-inputWrapper" tabindex="0">
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
</div>
Expand Down Expand Up @@ -7830,7 +7830,7 @@ <h2 id="Google-Trends">Google Trends<a class="anchor-link" href="#Google-Trends"
</div>
</div>
</div></section><section>
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=b65f5f93">
<div class="jp-Cell jp-MarkdownCell jp-Notebook-cell" id="cell-id=c20d80af">
<div class="jp-Cell-inputWrapper" tabindex="0">
<div class="jp-Collapser jp-InputCollapser jp-Cell-inputCollapser">
</div>
Expand Down
6 changes: 0 additions & 6 deletions docs/text/intro.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# Introduction

## Presentation

<div>
<iframe src="https://worldbank.github.io/pacific-observatory/interactive/text/text_presentation.slides.html" frameborder="0" marginwidth="0" marginheight="0" width="800" height="500"></iframe>
</div>

## Economic Policy Uncertainty (EPU) Index

Baker, Bloom, and Davis (2016) developed Economic Policy Uncertainty Index by exploiting the mention of economic, policy, and uncertainty group of terms on newspapers, and found that "innovations in policy uncertainty foreshadow declines in investment, output, and employment in the United States and … other 12 major economies."​
Expand Down
10 changes: 5 additions & 5 deletions notebooks/text/text_presentation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@
}
},
"source": [
"## Sentimental Analysis"
"## Sentiment Analysis"
]
},
{
Expand Down Expand Up @@ -461,7 +461,7 @@
},
{
"cell_type": "markdown",
"id": "5c6f09db",
"id": "ebfaa60c",
"metadata": {
"slideshow": {
"slide_type": "subslide"
Expand Down Expand Up @@ -502,7 +502,7 @@
},
{
"cell_type": "markdown",
"id": "56ec029f",
"id": "5f313f26",
"metadata": {
"slideshow": {
"slide_type": "subslide"
Expand All @@ -515,7 +515,7 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "e739223b",
"id": "3f8eb6a8",
"metadata": {
"slideshow": {
"slide_type": "fragment"
Expand Down Expand Up @@ -571,7 +571,7 @@
},
{
"cell_type": "markdown",
"id": "b65f5f93",
"id": "c20d80af",
"metadata": {
"slideshow": {
"slide_type": "subslide"
Expand Down
70 changes: 29 additions & 41 deletions notebooks/text/word_embeddings.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
{
"cell_type": "code",
"execution_count": 1,
"id": "f7e0d625",
"id": "680ce9ad",
"metadata": {},
"outputs": [],
"source": [
Expand Down Expand Up @@ -35,7 +35,7 @@
{
"cell_type": "code",
"execution_count": 2,
"id": "62978b00",
"id": "68fbd1ef",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -56,7 +56,7 @@
{
"cell_type": "code",
"execution_count": 3,
"id": "c6d2d1f7",
"id": "47baa8f3",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -70,7 +70,7 @@
{
"cell_type": "code",
"execution_count": 4,
"id": "354823d7",
"id": "4341e797",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -85,7 +85,7 @@
{
"cell_type": "code",
"execution_count": 5,
"id": "9e6ef2ad",
"id": "6b963a69",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -114,7 +114,7 @@
{
"cell_type": "code",
"execution_count": 9,
"id": "798a3dfd",
"id": "1663643c",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -124,7 +124,7 @@
},
{
"cell_type": "markdown",
"id": "4e632757",
"id": "78ef2779",
"metadata": {},
"source": [
"## Glove"
Expand All @@ -133,7 +133,7 @@
{
"cell_type": "code",
"execution_count": 7,
"id": "984c86d4",
"id": "8b28b504",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -145,7 +145,7 @@
{
"cell_type": "code",
"execution_count": 10,
"id": "42cc393e",
"id": "70a2e779",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -163,7 +163,7 @@
{
"cell_type": "code",
"execution_count": 62,
"id": "c956582a",
"id": "8bc1cfa5",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -178,7 +178,7 @@
{
"cell_type": "code",
"execution_count": 28,
"id": "78f7c8fb",
"id": "559177a7",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -207,7 +207,7 @@
{
"cell_type": "code",
"execution_count": 21,
"id": "89304d48",
"id": "3ef2fcad",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -270,7 +270,7 @@
{
"cell_type": "code",
"execution_count": 30,
"id": "23593f88",
"id": "aab29c96",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -286,7 +286,7 @@
{
"cell_type": "code",
"execution_count": 31,
"id": "b91e72ee",
"id": "defcd22c",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -304,7 +304,7 @@
{
"cell_type": "code",
"execution_count": 32,
"id": "966d163b",
"id": "3510a20d",
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -332,7 +332,7 @@
{
"cell_type": "code",
"execution_count": 33,
"id": "7c09981e",
"id": "c2bb6e45",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -344,7 +344,7 @@
{
"cell_type": "code",
"execution_count": 40,
"id": "8d85380f",
"id": "478822eb",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -354,7 +354,7 @@
{
"cell_type": "code",
"execution_count": 41,
"id": "f9927dad",
"id": "0b8acadf",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -379,7 +379,7 @@
{
"cell_type": "code",
"execution_count": 46,
"id": "414cd674",
"id": "3ca9c5c4",
"metadata": {},
"outputs": [
{
Expand All @@ -405,7 +405,7 @@
},
{
"cell_type": "markdown",
"id": "dcda0ef6",
"id": "42cece66",
"metadata": {},
"source": [
"## Embedding Layer + CNN"
Expand All @@ -414,7 +414,7 @@
{
"cell_type": "code",
"execution_count": 87,
"id": "c529476d",
"id": "e4b230f8",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -428,8 +428,8 @@
},
{
"cell_type": "code",
"execution_count": 120,
"id": "6d8323b5",
"execution_count": 124,
"id": "a62ae52c",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -443,8 +443,8 @@
},
{
"cell_type": "code",
"execution_count": 121,
"id": "46b705e1",
"execution_count": 125,
"id": "d4715049",
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -461,22 +461,10 @@
},
{
"cell_type": "code",
"execution_count": 122,
"id": "c52523f2",
"execution_count": null,
"id": "9b527fed",
"metadata": {},
"outputs": [
{
"ename": "KeyboardInterrupt",
"evalue": "",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyboardInterrupt\u001b[0m Traceback (most recent call last)",
"Cell \u001b[0;32mIn[122], line 18\u001b[0m\n\u001b[1;32m 16\u001b[0m \u001b[38;5;66;03m# Create a weight matrix for the embedding layer\u001b[39;00m\n\u001b[1;32m 17\u001b[0m embedding_matrix \u001b[38;5;241m=\u001b[39m np\u001b[38;5;241m.\u001b[39mzeros((vocab_size, \u001b[38;5;241m300\u001b[39m))\n\u001b[0;32m---> 18\u001b[0m \u001b[38;5;28;01mfor\u001b[39;00m word, i \u001b[38;5;129;01min\u001b[39;00m tokenizer\u001b[38;5;241m.\u001b[39mword_index\u001b[38;5;241m.\u001b[39mitems():\n\u001b[1;32m 19\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m word \u001b[38;5;129;01min\u001b[39;00m glove_vectors\u001b[38;5;241m.\u001b[39mindex_to_key:\n\u001b[1;32m 20\u001b[0m embedding_matrix[i] \u001b[38;5;241m=\u001b[39m glove_vectors[word]\n",
"\u001b[0;31mKeyboardInterrupt\u001b[0m: "
]
}
],
"outputs": [],
"source": [
"# Tokenize the text data\n",
"tokenizer = Tokenizer()\n",
Expand Down Expand Up @@ -517,7 +505,7 @@
{
"cell_type": "code",
"execution_count": 93,
"id": "2eb19e13",
"id": "9087c312",
"metadata": {},
"outputs": [
{
Expand Down

0 comments on commit 46644be

Please sign in to comment.