diff --git a/Viz-experiments.ipynb b/Viz-experiments.ipynb index 05c42e61..4d4abfee 100644 --- a/Viz-experiments.ipynb +++ b/Viz-experiments.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "f604fe38", + "id": "13525c0a", "metadata": {}, "source": [ "# Visualization Experiments" @@ -10,7 +10,7 @@ }, { "cell_type": "markdown", - "id": "cad594ed", + "id": "99b6a77c", "metadata": {}, "source": [ "Lets load the data artefacts to local memory. These files are to be downloaded from S3 as the pipeline automatically uploads them to the pre-configured S3 bucket." @@ -18,22 +18,33 @@ }, { "cell_type": "code", - "execution_count": null, - "id": "dbd7b93d", + "execution_count": 24, + "id": "455ba9af", "metadata": {}, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "\u001b[32m2023-06-14 18:01:52.751\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mfile_util\u001b[0m:\u001b[36mdownload_files\u001b[0m:\u001b[36m36\u001b[0m - \u001b[1mDownloading file df.pkl\u001b[0m\n", + "\u001b[32m2023-06-14 18:01:56.546\u001b[0m | \u001b[1mINFO \u001b[0m | \u001b[36mfile_util\u001b[0m:\u001b[36mdownload_files\u001b[0m:\u001b[36m36\u001b[0m - \u001b[1mDownloading file mappings.pkl\u001b[0m\n" + ] + } + ], "source": [ "from file_util import download_files\n", "import pickle\n", "\n", "# Download files from S3 bucket. You can download multiple files at a time by passing a list of names\n", - "files_to_download = [\"df.pkl\", \"mapping.pkl\"]\n" + "files_to_download = [\"df.pkl\", \"mappings.pkl\"]\n", + "download_files(files_to_download)\n", + "\n" ] }, { "cell_type": "code", "execution_count": null, - "id": "f59ff46b", + "id": "fcef3f4d", "metadata": {}, "outputs": [], "source": [ @@ -44,7 +55,7 @@ { "cell_type": "code", "execution_count": 16, - "id": "61aee352", + "id": "01aa4dc3", "metadata": {}, "outputs": [], "source": [ @@ -57,7 +68,15 @@ }, { "cell_type": "markdown", - "id": "5584c887", + "id": "2e344353", + "metadata": {}, + "source": [ + "## Example template 1" + ] + }, + { + "cell_type": "markdown", + "id": "ec7c2c55", "metadata": {}, "source": [ "## Scatter plot of transcription with Topic modelling" @@ -65,7 +84,7 @@ }, { "cell_type": "markdown", - "id": "5fae1776", + "id": "71921ceb", "metadata": {}, "source": [ "Change the values of \"category\", \"category_name\" to one agenda topic and change the value of \"not_category_name\" and see different plots." @@ -108,16 +127,577 @@ }, { "cell_type": "markdown", - "id": "e2d6ec49", + "id": "3c8ef97d", "metadata": {}, "source": [ "## Timeline visualizer" ] }, + { + "cell_type": "code", + "execution_count": 25, + "id": "fa95284d", + "metadata": {}, + "outputs": [], + "source": [ + "mappings = pickle.load(open(\"mappings.pkl\", \"rb\"))" + ] + }, + { + "cell_type": "code", + "execution_count": 26, + "id": "7d588df9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/plain": [ + "[{(0.0, 46.16): 'TAM',\n", + " (46.16, 52.32): 'Founders',\n", + " (52.32, 58.0): 'Founders',\n", + " (59.92, 69.92): 'Founders',\n", + " (69.92, 75.6): 'Founders',\n", + " (75.6, 80.48): 'AGENDA',\n", + " (80.48, 86.24): 'Founders',\n", + " (86.24, 91.6): 'Founders',\n", + " (92.32, 98.64): 'Founders',\n", + " (99.36, 103.12): 'Founders',\n", + " (103.12, 110.0): 'Founders',\n", + " (110.0, 114.0): 'Founders',\n", + " (114.0, 125.92): 'Founders',\n", + " (125.92, 129.6): 'Founders',\n", + " (129.6, 134.64): 'TAM',\n", + " (134.64, 140.32): 'TAM',\n", + " (140.32, 144.24): 'Founders',\n", + " (144.24, 148.64): 'Founders',\n", + " (148.64, 156.08): 'Founders',\n", + " (156.08, 167.0): 'Founders',\n", + " (167.0, 186.14): 'Founders',\n", + " (186.14, 188.18): 'Founders',\n", + " (188.18, 191.46): 'Founders',\n", + " (191.46, 193.14): 'TAM',\n", + " (193.14, 196.38): 'Founders',\n", + " (196.38, 200.08): 'TAM',\n", + " (200.08, 202.54): 'Founders',\n", + " (202.54, 226.0): 'Founders',\n", + " (226.0, 228.0): 'Founders',\n", + " (228.0, 230.0): 'TAM',\n", + " (230.0, 236.0): 'TAM',\n", + " (236.0, 240.0): 'Product market fit',\n", + " (240.0, 244.0): 'TAM',\n", + " (244.0, 246.96): 'Founders',\n", + " (246.96, 251.12): 'Founders',\n", + " (251.12, 255.36): 'Product market fit',\n", + " (255.36, 259.68): 'Founders',\n", + " (259.68, 263.44): 'Founders',\n", + " (263.44, 268.16): 'Product market fit',\n", + " (268.16, 274.24): 'Product market fit',\n", + " (274.24, 279.2): 'Founders',\n", + " (279.2, 293.0): 'Product market fit',\n", + " (293.0, 299.0): 'Product market fit',\n", + " (299.0, 305.68): 'Founders',\n", + " (308.24, 326.52): 'TAM',\n", + " (326.52, 328.84): 'Founders',\n", + " (328.84, 330.6): 'Product market fit',\n", + " (330.6, 334.2): 'Unit economics',\n", + " (334.2, 337.12): 'Product market fit',\n", + " (337.12, 339.72): 'Founders',\n", + " (339.72, 341.32): 'Founders',\n", + " (341.32, 344.6): 'Founders',\n", + " (344.6, 349.68): 'TAM',\n", + " (349.68, 355.28): 'Founders',\n", + " (355.28, 386.72): 'Founders',\n", + " (386.72, 394.96): 'Founders',\n", + " (394.96, 401.68): 'Founders',\n", + " (401.68, 425.6): 'Founders',\n", + " (426.24, 430.96): 'Product market fit',\n", + " (430.96, 435.36): 'Founders',\n", + " (435.36, 440.48): 'Founders',\n", + " (440.48, 448.16): 'Founders',\n", + " (448.16, 451.16): 'Product market fit',\n", + " (451.16, 454.08): 'Product market fit',\n", + " (454.08, 456.48): 'TAM',\n", + " (456.48, 459.52): 'TAM',\n", + " (459.52, 460.6): 'Founders',\n", + " (460.6, 463.2): 'Founders',\n", + " (463.2, 507.0): 'Founders',\n", + " (508.0, 585.84): 'Product market fit',\n", + " (585.84, 591.68): 'Founders',\n", + " (592.48, 598.08): 'TAM',\n", + " (599.12, 603.76): 'Founders',\n", + " (603.76, 625.76): 'Founders',\n", + " (625.76, 629.2): 'TAM',\n", + " (629.2, 636.4): 'Founders',\n", + " (636.4, 639.68): 'Founders',\n", + " (639.68, 644.56): 'Founders',\n", + " (644.56, 652.0): 'Founders',\n", + " (652.0, 656.0): 'Founders',\n", + " (656.0, 665.04): 'Founders',\n", + " (668.96, 674.88): 'Founders',\n", + " (679.76, 684.96): 'Founders',\n", + " (730.0, 746.16): 'Founders',\n", + " (746.16, 751.68): 'TAM',\n", + " (751.68, 756.8): 'AGENDA',\n", + " (757.92, 764.48): 'Founders',\n", + " (764.48, 808.0): 'TAM',\n", + " (808.0, 813.0): 'Founders',\n", + " (813.0, 837.5): 'Founders',\n", + " (844.24, 848.72): 'TAM',\n", + " (848.72, 854.16): 'TAM',\n", + " (855.28, 860.08): 'TAM',\n", + " (860.08, 868.48): 'Founders',\n", + " (868.48, 875.76): 'TAM',\n", + " (875.76, 880.64): 'AGENDA',\n", + " (882.24, 906.0): 'Founders',\n", + " (906.0, 926.4): 'Product market fit',\n", + " (926.4, 933.2): 'Product market fit',\n", + " (933.2, 938.72): 'Founders',\n", + " (938.72, 944.0): 'Founders',\n", + " (944.0, 945.76): 'Founders',\n", + " (946.96, 951.96): 'TAM',\n", + " (952.24, 956.48): 'Founders',\n", + " (958.48, 969.2): 'Founders',\n", + " (969.8, 980.24): 'Founders',\n", + " (1025.28, 1029.6): 'Founders',\n", + " (1029.6, 1035.6): 'TAM',\n", + " (1036.32, 1043.84): 'Churn',\n", + " (1047.6, 1051.84): 'Founders',\n", + " (1051.84, 1056.16): 'Founders',\n", + " (1056.16, 1060.8): 'Product market fit',\n", + " (1060.8, 1069.76): 'Founders',\n", + " (1070.4, 1076.56): 'Founders',\n", + " (1076.56, 1080.8): 'TAM',\n", + " (1080.8, 1089.12): 'Founders',\n", + " (1089.12, 1094.32): 'Founders',\n", + " (1094.32, 1099.76): 'Founders',\n", + " (1099.76, 1103.04): 'Founders',\n", + " (1103.92, 1105.44): 'Founders',\n", + " (1105.48, 1110.96): 'Founders',\n", + " (1111.28, 1117.76): 'TAM',\n", + " (1118.4, 1126.0): 'TAM',\n", + " (1126.0, 1131.28): 'AGENDA',\n", + " (1131.28, 1136.48): 'Founders',\n", + " (1136.48, 1140.72): 'Product market fit',\n", + " (1140.72, 1188.4): 'Founders',\n", + " (1188.4, 1199.52): 'Founders',\n", + " (1210.48, 1211.08): 'TAM',\n", + " (1213.32, 1216.36): 'Founders',\n", + " (1223.72, 1224.28): 'Founders',\n", + " (1239.0, 1255.0): 'Founders',\n", + " (1255.0, 1268.0): 'TAM',\n", + " (1268.0, 1277.0): 'Founders',\n", + " (1277.0, 1285.36): 'Founders',\n", + " (1286.48, 1290.96): 'TAM',\n", + " (1290.96, 1296.56): 'Unit economics',\n", + " (1297.36, 1303.04): 'Founders',\n", + " (1303.04, 1310.0): 'Founders',\n", + " (1310.0, 1346.8): 'Founders',\n", + " (1347.2, 1351.2): 'Founders',\n", + " (1351.7, 1362.2): 'TAM',\n", + " (1366.0, 1372.0): 'Founders',\n", + " (1372.0, 1376.0): 'TAM',\n", + " (1376.0, 1382.0): 'Founders',\n", + " (1382.0, 1386.0): 'TAM',\n", + " (1400.56, 1401.36): 'Founders',\n", + " (1406.08, 1410.64): 'TAM',\n", + " (1410.64, 1416.48): 'Founders',\n", + " (1416.48, 1422.72): 'Founders',\n", + " (1422.72, 1449.0): 'Founders',\n", + " (1449.0, 1455.0): 'TAM',\n", + " (1455.0, 1458.0): 'TAM',\n", + " (1458.0, 1464.0): 'Founders',\n", + " (1464.0, 1466.4): 'AGENDA',\n", + " (1469.92, 1475.84): 'Founders',\n", + " (1476.4, 1481.76): 'Founders',\n", + " (1483.12, 1486.64): 'TAM',\n", + " (1486.64, 1491.6): 'Founders',\n", + " (1491.6, 1497.28): 'TAM',\n", + " (1497.28, 1503.04): 'Founders',\n", + " (1503.04, 1530.08): 'Founders',\n", + " (1530.08, 1539.92): 'TAM',\n", + " (1539.92, 1630.0): 'TAM',\n", + " (1630.0, 1637.0): 'Founders',\n", + " (1637.0, 1665.04): 'Founders',\n", + " (1665.04, 1670.72): 'Founders',\n", + " (1670.72, 1674.72): 'Founders',\n", + " (1674.72, 1681.2): 'Founders',\n", + " (1681.2, 1689.0): 'Founders',\n", + " (1689.0, 1696.0): 'Founders',\n", + " (1696.0, 1705.12): 'TAM',\n", + " (1705.12, 1710.0): 'Founders',\n", + " (1710.0, 1715.36): 'Founders',\n", + " (1715.36, 1720.4): 'Founders',\n", + " (1721.68, 1726.48): 'TAM',\n", + " (1726.48, 1732.0): 'TAM',\n", + " (1732.0, 1737.84): 'TAM',\n", + " (1737.84, 1742.0): 'AGENDA',\n", + " (1742.0, 1745.2): 'TAM',\n", + " (1745.2, 1752.4): 'Founders',\n", + " (1752.4, 1758.4): 'TAM',\n", + " (1758.4, 1789.6): 'Founders',\n", + " (1789.6, 1792.12): 'TAM',\n", + " (1792.12, 1796.52): 'TAM',\n", + " (1796.52, 1800.2): 'TAM',\n", + " (1800.2, 1804.52): 'AGENDA',\n", + " (1804.52, 1806.8): 'Founders',\n", + " (1807.2, 1812.26): 'Founders',\n", + " (1812.26, 1817.76): 'Founders',\n", + " (1818.84, 1823.6): 'Business',\n", + " (1827.6, 1834.08): 'Founders',\n", + " (1834.08, 1839.12): 'Founders',\n", + " (1839.12, 1843.68): 'TAM',\n", + " (1843.68, 1845.48): 'Founders',\n", + " (1846.48, 1869.36): 'Founders',\n", + " (1869.36, 1874.08): 'Founders',\n", + " (1874.08, 1877.76): 'Founders',\n", + " (1877.76, 1881.28): 'Founders',\n", + " (1881.28, 1927.2): 'TAM',\n", + " (1927.2, 1931.92): 'Founders',\n", + " (1931.92, 1935.92): 'TAM',\n", + " (1937.12, 1941.44): 'TAM',\n", + " (1941.44, 1966.08): 'Founders',\n", + " (1966.08, 1971.52): 'Product market fit',\n", + " (1971.52, 1976.32): 'Founders',\n", + " (1976.32, 1980.48): 'Founders',\n", + " (1980.48, 1984.56): 'AGENDA',\n", + " (2007.38, 2021.0): 'TAM',\n", + " (2027.42, 2034.26): 'Founders',\n", + " (2034.26, 2065.92): 'TAM',\n", + " (2065.92, 2073.52): 'Founders',\n", + " (2073.52, 2077.28): 'TAM',\n", + " (2077.84, 2081.12): 'TAM',\n", + " (2081.12, 2089.84): 'TAM',\n", + " (2089.84, 2094.32): 'TAM',\n", + " (2094.32, 2100.88): 'TAM',\n", + " (2100.88, 2104.88): 'Founders',\n", + " (2104.88, 2110.4): 'Founders',\n", + " (2110.4, 2115.0): 'Founders',\n", + " (2115.5, 2120.8): 'Founders',\n", + " (2120.8, 2122.7): 'Founders',\n", + " (2122.9, 2127.0): 'Product market fit',\n", + " (2127.0, 2131.0): 'TAM',\n", + " (2131.0, 2135.0): 'Founders',\n", + " (2135.0, 2141.0): 'TAM',\n", + " (2141.0, 2205.0): 'Founders',\n", + " (2205.64, 2208.84): 'Founders',\n", + " (2208.84, 2211.64): 'Founders',\n", + " (2211.64, 2214.76): 'Business',\n", + " (2214.76, 2217.64): 'Founders',\n", + " (2217.64, 2220.36): 'Product market fit',\n", + " (2220.36, 2222.12): 'Founders',\n", + " (2222.12, 2224.84): 'Product market fit',\n", + " (2224.84, 2257.0): 'Founders',\n", + " (2257.0, 2268.88): 'Founders',\n", + " (2268.88, 2273.2): 'Founders',\n", + " (2273.2, 2278.72): 'TAM',\n", + " (2278.72, 2284.0): 'Founders',\n", + " (2284.0, 2285.12): 'Founders',\n", + " (2285.12, 2289.04): 'TAM',\n", + " (2289.04, 2292.16): 'AGENDA',\n", + " (2292.16, 2296.4): 'Founders',\n", + " (2297.44, 2303.12): 'Founders',\n", + " (2303.12, 2370.0): 'Founders',\n", + " (2370.0, 2377.0): 'TAM',\n", + " (2377.0, 2387.44): 'Founders',\n", + " (2387.44, 2393.36): 'Founders',\n", + " (2393.36, 2397.84): 'Founders',\n", + " (2397.84, 2403.04): 'Founders',\n", + " (2403.04, 2442.0): 'Founders',\n", + " (2467.56, 2468.52): 'Founders',\n", + " (2469.88, 2472.44): 'AGENDA',\n", + " (2472.44, 2474.96): 'Product market fit',\n", + " (2474.96, 2478.8): 'Founders',\n", + " (2478.8, 2481.16): 'Founders',\n", + " (2481.16, 2484.8): 'AGENDA',\n", + " (2484.8, 2526.44): 'Founders',\n", + " (2521.59, 2527.91): 'Founders'},\n", + " {(0.0, 46.16): 'Founders',\n", + " (46.16, 52.32): 'TAM',\n", + " (52.32, 58.0): 'AGENDA',\n", + " (59.92, 69.92): 'TAM',\n", + " (69.92, 75.6): 'AGENDA',\n", + " (75.6, 80.48): 'Product market fit',\n", + " (80.48, 86.24): 'AGENDA',\n", + " (86.24, 91.6): 'TAM',\n", + " (92.32, 98.64): 'TAM',\n", + " (99.36, 103.12): 'AGENDA',\n", + " (103.12, 110.0): 'Product market fit',\n", + " (110.0, 114.0): 'AGENDA',\n", + " (114.0, 125.92): 'TAM',\n", + " (125.92, 129.6): 'TAM',\n", + " (129.6, 134.64): 'Founders',\n", + " (134.64, 140.32): 'Founders',\n", + " (140.32, 144.24): 'TAM',\n", + " (144.24, 148.64): 'AGENDA',\n", + " (148.64, 156.08): 'AGENDA',\n", + " (156.08, 167.0): 'TAM',\n", + " (167.0, 186.14): 'TAM',\n", + " (186.14, 188.18): 'TAM',\n", + " (188.18, 191.46): 'TAM',\n", + " (191.46, 193.14): 'Founders',\n", + " (193.14, 196.38): 'TAM',\n", + " (196.38, 200.08): 'Founders',\n", + " (200.08, 202.54): 'TAM',\n", + " (202.54, 226.0): 'TAM',\n", + " (226.0, 228.0): 'TAM',\n", + " (228.0, 230.0): 'Founders',\n", + " (230.0, 236.0): 'Founders',\n", + " (236.0, 240.0): 'Founders',\n", + " (240.0, 244.0): 'Founders',\n", + " (244.0, 246.96): 'TAM',\n", + " (246.96, 251.12): 'TAM',\n", + " (251.12, 255.36): 'Founders',\n", + " (255.36, 259.68): 'TAM',\n", + " (259.68, 263.44): 'AGENDA',\n", + " (263.44, 268.16): 'AGENDA',\n", + " (268.16, 274.24): 'AGENDA',\n", + " (274.24, 279.2): 'TAM',\n", + " (279.2, 293.0): 'TAM',\n", + " (293.0, 299.0): 'Founders',\n", + " (299.0, 305.68): 'TAM',\n", + " (308.24, 326.52): 'Founders',\n", + " (326.52, 328.84): 'Product market fit',\n", + " (328.84, 330.6): 'Founders',\n", + " (330.6, 334.2): 'Product market fit',\n", + " (334.2, 337.12): 'Founders',\n", + " (337.12, 339.72): 'TAM',\n", + " (339.72, 341.32): 'TAM',\n", + " (341.32, 344.6): 'TAM',\n", + " (344.6, 349.68): 'Founders',\n", + " (349.68, 355.28): 'TAM',\n", + " (355.28, 386.72): 'TAM',\n", + " (386.72, 394.96): 'TAM',\n", + " (394.96, 401.68): 'Product market fit',\n", + " (401.68, 425.6): 'TAM',\n", + " (426.24, 430.96): 'Founders',\n", + " (430.96, 435.36): 'TAM',\n", + " (435.36, 440.48): 'TAM',\n", + " (440.48, 448.16): 'TAM',\n", + " (448.16, 451.16): 'AGENDA',\n", + " (451.16, 454.08): 'AGENDA',\n", + " (454.08, 456.48): 'Founders',\n", + " (456.48, 459.52): 'Founders',\n", + " (459.52, 460.6): 'AGENDA',\n", + " (460.6, 463.2): 'TAM',\n", + " (463.2, 507.0): 'TAM',\n", + " (508.0, 585.84): 'AGENDA',\n", + " (585.84, 591.68): 'AGENDA',\n", + " (592.48, 598.08): 'Founders',\n", + " (599.12, 603.76): 'TAM',\n", + " (603.76, 625.76): 'TAM',\n", + " (625.76, 629.2): 'AGENDA',\n", + " (629.2, 636.4): 'Churn',\n", + " (636.4, 639.68): 'TAM',\n", + " (639.68, 644.56): 'TAM',\n", + " (644.56, 652.0): 'TAM',\n", + " (652.0, 656.0): 'TAM',\n", + " (656.0, 665.04): 'TAM',\n", + " (668.96, 674.88): 'TAM',\n", + " (679.76, 684.96): 'TAM',\n", + " (730.0, 746.16): 'TAM',\n", + " (746.16, 751.68): 'Founders',\n", + " (751.68, 756.8): 'Founders',\n", + " (757.92, 764.48): 'TAM',\n", + " (764.48, 808.0): 'Founders',\n", + " (808.0, 813.0): 'TAM',\n", + " (813.0, 837.5): 'TAM',\n", + " (844.24, 848.72): 'Founders',\n", + " (848.72, 854.16): 'Founders',\n", + " (855.28, 860.08): 'Founders',\n", + " (860.08, 868.48): 'AGENDA',\n", + " (868.48, 875.76): 'Founders',\n", + " (875.76, 880.64): 'Product market fit',\n", + " (882.24, 906.0): 'TAM',\n", + " (906.0, 926.4): 'AGENDA',\n", + " (926.4, 933.2): 'AGENDA',\n", + " (933.2, 938.72): 'TAM',\n", + " (938.72, 944.0): 'TAM',\n", + " (944.0, 945.76): 'TAM',\n", + " (946.96, 951.96): 'Founders',\n", + " (952.24, 956.48): 'TAM',\n", + " (958.48, 969.2): 'TAM',\n", + " (969.8, 980.24): 'TAM',\n", + " (1025.28, 1029.6): 'TAM',\n", + " (1029.6, 1035.6): 'Founders',\n", + " (1036.32, 1043.84): 'Product market fit',\n", + " (1047.6, 1051.84): 'TAM',\n", + " (1051.84, 1056.16): 'TAM',\n", + " (1056.16, 1060.8): 'Founders',\n", + " (1060.8, 1069.76): 'TAM',\n", + " (1070.4, 1076.56): 'TAM',\n", + " (1076.56, 1080.8): 'Founders',\n", + " (1080.8, 1089.12): 'TAM',\n", + " (1089.12, 1094.32): 'AGENDA',\n", + " (1094.32, 1099.76): 'Product market fit',\n", + " (1099.76, 1103.04): 'AGENDA',\n", + " (1103.92, 1105.44): 'AGENDA',\n", + " (1105.48, 1110.96): 'TAM',\n", + " (1111.28, 1117.76): 'Founders',\n", + " (1118.4, 1126.0): 'Founders',\n", + " (1126.0, 1131.28): 'TAM',\n", + " (1131.28, 1136.48): 'AGENDA',\n", + " (1136.48, 1140.72): 'TAM',\n", + " (1140.72, 1188.4): 'TAM',\n", + " (1188.4, 1199.52): 'AGENDA',\n", + " (1210.48, 1211.08): 'Founders',\n", + " (1213.32, 1216.36): 'TAM',\n", + " (1223.72, 1224.28): 'TAM',\n", + " (1239.0, 1255.0): 'TAM',\n", + " (1255.0, 1268.0): 'Founders',\n", + " (1268.0, 1277.0): 'TAM',\n", + " (1277.0, 1285.36): 'TAM',\n", + " (1286.48, 1290.96): 'Founders',\n", + " (1290.96, 1296.56): 'Churn',\n", + " (1297.36, 1303.04): 'TAM',\n", + " (1303.04, 1310.0): 'TAM',\n", + " (1310.0, 1346.8): 'TAM',\n", + " (1347.2, 1351.2): 'TAM',\n", + " (1351.7, 1362.2): 'Founders',\n", + " (1366.0, 1372.0): 'TAM',\n", + " (1372.0, 1376.0): 'Founders',\n", + " (1376.0, 1382.0): 'TAM',\n", + " (1382.0, 1386.0): 'Founders',\n", + " (1400.56, 1401.36): 'TAM',\n", + " (1406.08, 1410.64): 'Founders',\n", + " (1410.64, 1416.48): 'AGENDA',\n", + " (1416.48, 1422.72): 'TAM',\n", + " (1422.72, 1449.0): 'TAM',\n", + " (1449.0, 1455.0): 'Founders',\n", + " (1455.0, 1458.0): 'Founders',\n", + " (1458.0, 1464.0): 'TAM',\n", + " (1464.0, 1466.4): 'Founders',\n", + " (1469.92, 1475.84): 'TAM',\n", + " (1476.4, 1481.76): 'TAM',\n", + " (1483.12, 1486.64): 'Founders',\n", + " (1486.64, 1491.6): 'TAM',\n", + " (1491.6, 1497.28): 'AGENDA',\n", + " (1497.28, 1503.04): 'TAM',\n", + " (1503.04, 1530.08): 'TAM',\n", + " (1530.08, 1539.92): 'Founders',\n", + " (1539.92, 1630.0): 'Founders',\n", + " (1630.0, 1637.0): 'Product market fit',\n", + " (1637.0, 1665.04): 'TAM',\n", + " (1665.04, 1670.72): 'Product market fit',\n", + " (1670.72, 1674.72): 'Churn',\n", + " (1674.72, 1681.2): 'TAM',\n", + " (1681.2, 1689.0): 'AGENDA',\n", + " (1689.0, 1696.0): 'TAM',\n", + " (1696.0, 1705.12): 'Founders',\n", + " (1705.12, 1710.0): 'TAM',\n", + " (1710.0, 1715.36): 'Product market fit',\n", + " (1715.36, 1720.4): 'TAM',\n", + " (1721.68, 1726.48): 'Founders',\n", + " (1726.48, 1732.0): 'Founders',\n", + " (1732.0, 1737.84): 'Product market fit',\n", + " (1737.84, 1742.0): 'Founders',\n", + " (1742.0, 1745.2): 'Founders',\n", + " (1745.2, 1752.4): 'TAM',\n", + " (1752.4, 1758.4): 'Founders',\n", + " (1758.4, 1789.6): 'TAM',\n", + " (1789.6, 1792.12): 'AGENDA',\n", + " (1792.12, 1796.52): 'AGENDA',\n", + " (1796.52, 1800.2): 'Founders',\n", + " (1800.2, 1804.52): 'Product market fit',\n", + " (1804.52, 1806.8): 'AGENDA',\n", + " (1807.2, 1812.26): 'TAM',\n", + " (1812.26, 1817.76): 'TAM',\n", + " (1818.84, 1823.6): 'AGENDA',\n", + " (1827.6, 1834.08): 'TAM',\n", + " (1834.08, 1839.12): 'AGENDA',\n", + " (1839.12, 1843.68): 'Founders',\n", + " (1843.68, 1845.48): 'AGENDA',\n", + " (1846.48, 1869.36): 'AGENDA',\n", + " (1869.36, 1874.08): 'TAM',\n", + " (1874.08, 1877.76): 'TAM',\n", + " (1877.76, 1881.28): 'AGENDA',\n", + " (1881.28, 1927.2): 'Founders',\n", + " (1927.2, 1931.92): 'AGENDA',\n", + " (1931.92, 1935.92): 'Founders',\n", + " (1937.12, 1941.44): 'Product market fit',\n", + " (1941.44, 1966.08): 'TAM',\n", + " (1966.08, 1971.52): 'TAM',\n", + " (1971.52, 1976.32): 'TAM',\n", + " (1976.32, 1980.48): 'TAM',\n", + " (1980.48, 1984.56): 'Founders',\n", + " (2007.38, 2021.0): 'Product market fit',\n", + " (2027.42, 2034.26): 'TAM',\n", + " (2034.26, 2065.92): 'Founders',\n", + " (2065.92, 2073.52): 'Product market fit',\n", + " (2073.52, 2077.28): 'Founders',\n", + " (2077.84, 2081.12): 'Founders',\n", + " (2081.12, 2089.84): 'Founders',\n", + " (2089.84, 2094.32): 'Founders',\n", + " (2094.32, 2100.88): 'Founders',\n", + " (2100.88, 2104.88): 'AGENDA',\n", + " (2104.88, 2110.4): 'Business',\n", + " (2110.4, 2115.0): 'AGENDA',\n", + " (2115.5, 2120.8): 'AGENDA',\n", + " (2120.8, 2122.7): 'TAM',\n", + " (2122.9, 2127.0): 'AGENDA',\n", + " (2127.0, 2131.0): 'Founders',\n", + " (2131.0, 2135.0): 'TAM',\n", + " (2135.0, 2141.0): 'Founders',\n", + " (2141.0, 2205.0): 'TAM',\n", + " (2205.64, 2208.84): 'AGENDA',\n", + " (2208.84, 2211.64): 'AGENDA',\n", + " (2211.64, 2214.76): 'AGENDA',\n", + " (2214.76, 2217.64): 'AGENDA',\n", + " (2217.64, 2220.36): 'TAM',\n", + " (2220.36, 2222.12): 'Product market fit',\n", + " (2222.12, 2224.84): 'AGENDA',\n", + " (2224.84, 2257.0): 'TAM',\n", + " (2257.0, 2268.88): 'TAM',\n", + " (2268.88, 2273.2): 'AGENDA',\n", + " (2273.2, 2278.72): 'Founders',\n", + " (2278.72, 2284.0): 'TAM',\n", + " (2284.0, 2285.12): 'TAM',\n", + " (2285.12, 2289.04): 'Founders',\n", + " (2289.04, 2292.16): 'Founders',\n", + " (2292.16, 2296.4): 'AGENDA',\n", + " (2297.44, 2303.12): 'TAM',\n", + " (2303.12, 2370.0): 'TAM',\n", + " (2370.0, 2377.0): 'Founders',\n", + " (2377.0, 2387.44): 'Churn',\n", + " (2387.44, 2393.36): 'TAM',\n", + " (2393.36, 2397.84): 'TAM',\n", + " (2397.84, 2403.04): 'AGENDA',\n", + " (2403.04, 2442.0): 'TAM',\n", + " (2467.56, 2468.52): 'TAM',\n", + " (2469.88, 2472.44): 'TAM',\n", + " (2472.44, 2474.96): 'AGENDA',\n", + " (2474.96, 2478.8): 'TAM',\n", + " (2478.8, 2481.16): 'Product market fit',\n", + " (2481.16, 2484.8): 'Product market fit',\n", + " (2484.8, 2526.44): 'TAM',\n", + " (2521.59, 2527.91): 'AGENDA'},\n", + " {'TAM': (2370.0, 2377.0),\n", + " 'Founders': (2521.59, 2527.91),\n", + " 'AGENDA': (2481.16, 2484.8),\n", + " 'Product market fit': (2472.44, 2474.96),\n", + " 'Unit economics': (1290.96, 1296.56),\n", + " 'Churn': (1036.32, 1043.84),\n", + " 'Business': (2211.64, 2214.76)},\n", + " {'Founders': (2370.0, 2377.0),\n", + " 'TAM': (2484.8, 2526.44),\n", + " 'AGENDA': (2521.59, 2527.91),\n", + " 'Product market fit': (2481.16, 2484.8),\n", + " 'Churn': (2377.0, 2387.44),\n", + " 'Business': (2104.88, 2110.4)}]" + ] + }, + "execution_count": 26, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "mappings" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "08e83128", + "id": "edb167a7", "metadata": {}, "outputs": [], "source": [] diff --git a/whisjax.py b/whisjax.py index 405a75b8..2f086e64 100644 --- a/whisjax.py +++ b/whisjax.py @@ -6,6 +6,7 @@ import argparse import ast +import collections import configparser import jax.numpy as jnp import matplotlib.pyplot as plt @@ -159,8 +160,8 @@ def create_talk_diff_scatter_viz(): ts_to_topic_mapping_top_2 = {} # Also create a mapping of the different timestamps in which each topic was covered - topic_to_ts_mapping_top_1 = {} - topic_to_ts_mapping_top_2 = {} + topic_to_ts_mapping_top_1 = collections.defaultdict(list) + topic_to_ts_mapping_top_2 = collections.defaultdict(list) similarity_threshold = 0.7 @@ -181,11 +182,11 @@ def create_talk_diff_scatter_viz(): # top1 match if i == 0: ts_to_topic_mapping_top_1[c["timestamp"]] = agenda_topics[topic_similarities[i][0]] - topic_to_ts_mapping_top_1[agenda_topics[topic_similarities[i][0]]] = c["timestamp"] + topic_to_ts_mapping_top_1[agenda_topics[topic_similarities[i][0]]].append(c["timestamp"]) # top2 match else: ts_to_topic_mapping_top_2[c["timestamp"]] = agenda_topics[topic_similarities[i][0]] - topic_to_ts_mapping_top_2[agenda_topics[topic_similarities[i][0]]] = c["timestamp"] + topic_to_ts_mapping_top_2[agenda_topics[topic_similarities[i][0]]].append(c["timestamp"]) def create_new_columns(record): """