From 43b151f3c9f59f19a8abec4e295eadb370286952 Mon Sep 17 00:00:00 2001 From: MarekToma Date: Fri, 23 Feb 2024 20:32:39 +0100 Subject: [PATCH] leaderboard update in notebook in case it does not work in iirhub --- notebooks/cranfield.ipynb | 221 ++++++++++++++++++++++++++++++++------ 1 file changed, 190 insertions(+), 31 deletions(-) diff --git a/notebooks/cranfield.ipynb b/notebooks/cranfield.ipynb index c5fdd69..15d8375 100644 --- a/notebooks/cranfield.ipynb +++ b/notebooks/cranfield.ipynb @@ -36,7 +36,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "id": "inUAfc6TQMVJ" }, @@ -59,7 +59,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 2, "metadata": { "id": "fyAqWIQyINng" }, @@ -103,7 +103,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 3, "metadata": { "id": "HfRrW7O6U5wb" }, @@ -118,11 +118,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": { "id": "DkeKUsWWWnb9" }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "\n", + "...\n", + "\n", + "\n", + "\n" + ] + } + ], "source": [ "print('\\n'.join(repr(document) for document in list(documents.values())[:3]))\n", "print('...')\n", @@ -131,11 +145,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": { "id": "kvsnuhT3ZZAo" }, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 5, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "document = documents['14']\n", "document" @@ -143,44 +168,76 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": { "id": "e-zw68v5Xoh5" }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "ashley,h. and zartarian,g.\n" + ] + } + ], "source": [ "print(document.authors)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": { "id": "p13FfuduZSRK" }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "j. ae. scs. 23, 1956, 1109.\n" + ] + } + ], "source": [ "print(document.bibliography)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": { "id": "z5bmj4WzZc9e" }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "piston theory - a new aerodynamic tool for the aeroelastician .\n" + ] + } + ], "source": [ "print(document.title)" ] }, { "cell_type": "code", - "execution_count": null, + "execution_count": 9, "metadata": { "id": "W3z7ed8SZkn6" }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "piston theory - a new aerodynamic tool for the aeroelastician . representative applications are described which illustrate the extent to which simplifications in the solutions of high-speed unsteady aeroelastic problems can be achieved through the use of certain aerodynamic techniques known collectively as /piston theory ./ based on a physical model originally proposed by hayes and lighthill, piston theory for airfoils and finite wings has been systematically developed by landahl, utilizing expansions in powers of the thickness ratio and the inverse of the flight mach number m . when contributions of orders and are negligible, the theory predicts a point-function relationship between the local pressure on the surface of a wing and the normal component of fluid velocity produced by the wing's motion . the computation of generalized forces in aeroelastic equations, such as the flutter determinant, is then always reduced to elementary integrations of the assumed modes of motion . essentially closed-form solutions are given for the bending- torsion and control-surface flutter properties of typical section airfoils at high mach numbers . these agree well with results of more exact theories wherever comparisons can be fairly made . moreover, they demonstrate the increasingly important influence of thickness and profile shape as m grows larger, a discovery that would be almost impossible using other available aerodynamic tools . the complexity of more practical flutter analyses-e.g., on three-dimensional wings and panels-is shown to be substantially reduced by piston theory . an iterative procedure is outlined, by which improved flutter eigenvalues can be found through the successive introduction of higher-order terms in and . other applications to unsteady supersonic problems are reviewed, including gust response and rapid maneuvers of elastic aircraft . steady-state aeroelastic calculations are also discussed, but for them piston theory amounts only to a slight modification of ackeret's formulas . suggestions are made regarding future research based on the new aerodynamic method, with particular emphasis on areas where computational labor can be reduced with a minimum loss of precision . it is pointed out that a mach number zone exists where thermal effects are appreciable but nonlinear viscous interactions may be neglected, and that in this zone piston theory is the logical way of estimating air loads when analyzing aerodynamic- thermoelastic interaction problems .\n" + ] + } + ], "source": [ "print(document.body)" ] @@ -197,7 +254,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 10, "metadata": { "id": "oaCFkMFdKjST" }, @@ -235,7 +292,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 11, "metadata": { "id": "8qcyQUNRqRTr" }, @@ -246,11 +303,25 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 12, "metadata": { "id": "IW-N6g3LqwPZ" }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "\n", + "\n", + "\n", + "...\n", + "\n", + "\n", + "\n" + ] + } + ], "source": [ "print('\\n'.join(repr(query) for query in list(queries.values())[:3]))\n", "print('...')\n", @@ -259,11 +330,22 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 13, "metadata": { "id": "VgdHjSYIq5HV" }, - "outputs": [], + "outputs": [ + { + "data": { + "text/plain": [ + "" + ] + }, + "execution_count": 13, + "metadata": {}, + "output_type": "execute_result" + } + ], "source": [ "query = queries[14]\n", "query" @@ -271,11 +353,19 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 14, "metadata": { "id": "w4NGZOdOq8NF" }, - "outputs": [], + "outputs": [ + { + "name": "stdout", + "output_type": "stream", + "text": [ + "papers on shock-sound wave interaction .\n" + ] + } + ], "source": [ "print(query.body)" ] @@ -296,11 +386,20 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 15, "metadata": { "id": "HRqgBUnh9IP8" }, - "outputs": [], + "outputs": [ + { + "name": "stderr", + "output_type": "stream", + "text": [ + "Building the dictionary: 100%|██████████| 1400/1400 [00:00<00:00, 10483.10it/s]\n", + "Building the index: 100%|██████████| 1400/1400 [00:00<00:00, 9804.44it/s]\n" + ] + } + ], "source": [ "from pv211_utils.systems import BoWSystem\n", "from pv211_utils.preprocessing import NoneDocPreprocessing\n", @@ -321,24 +420,84 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 16, "metadata": { "id": "ssX-nvxGu3JK" }, - "outputs": [], + "outputs": [ + { + "data": { + "text/markdown": [ + "Your system achieved **17.44% MAP score**." + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "You need at least **22%** to pass. 😢" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "Try playing with the preprocessing of queries and documents! 💡" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + }, + { + "data": { + "text/markdown": [ + "Set `submit_result = True` and write your name to the `author_name` variable to submit your result to [the leaderboard](https://docs.google.com/spreadsheets/d/e/2PACX-1vQga_qzgcLp_IcrOt5xZBq4Pq7jjTwmV6JLMRPwkLwG3K3dm2FrcZT-1GhGItFkNyAxwDaOzzFLOIdu/pubhtml). 🏆\n", + "\n", + "The best submissions on the leaderboard will receive *small awards during the semester*, and some *__seriously big__ awards* after the personal check at the end of the competition (2024-03-19). Please be polite, do not spoil the game for the others, and **have fun!** 😉" + ], + "text/plain": [ + "" + ] + }, + "metadata": {}, + "output_type": "display_data" + } + ], "source": [ "from pv211_utils.cranfield.loader import load_judgements\n", "from pv211_utils.cranfield.leaderboard import CranfieldLeaderboard\n", "from pv211_utils.cranfield.eval import CranfieldEvaluation\n", "\n", - "submit_result = False\n", - "author_name = 'Surname, Name'\n", + "submit_result = False \n", + "author_name = 'Toma, Marek'\n", "\n", "test_judgements = load_judgements(queries, documents)\n", "leaderboard = CranfieldLeaderboard()\n", + "leaderboard._get_spreadsheet_key = lambda: '1K_GnmMTjeacPaUmvjO79abrlqOV8JqvnoxoQICulpAw'\n", + "leaderboard.get_public_url = lambda: 'https://docs.google.com/spreadsheets/d/e/2PACX-1vQga_qzgcLp_IcrOt5xZBq4Pq7jjTwmV6JLMRPwkLwG3K3dm2FrcZT-1GhGItFkNyAxwDaOzzFLOIdu/pubhtml'\n", "evaluation = CranfieldEvaluation(system, test_judgements, leaderboard=leaderboard, author_name=author_name)\n", "evaluation.evaluate(queries, submit_result)\n" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -364,11 +523,11 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.10.12" + "version": "3.9.14" }, "vscode": { "interpreter": { - "hash": "916dbcbb3f70747c44a77c7bcd40155683ae19c65e1c03b4aa3499c5328201f1" + "hash": "97b31d6e62de2216a05dd9342162045e53cee058ed98d00a361b193ba69cab9f" } } },