{"id":14691,"date":"2024-12-03T09:45:32","date_gmt":"2024-12-03T01:45:32","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=14691"},"modified":"2024-12-03T09:47:11","modified_gmt":"2024-12-03T01:47:11","slug":"taipy","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/de\/taipy\/","title":{"rendered":"Taipy\uff1a\u4e3a\u6570\u636e\u79d1\u5b66\u5bb6\u6253\u9020\u7684\u9ad8\u6548\u6570\u636e\u5206\u6790\u4e0eAI\u5e94\u7528\u5f00\u6e90Python\u5e93"},"content":{"rendered":"<p>Taipy \u662f\u7531 Avaiga \u5f00\u53d1\u7684\u4e00\u4e2a\u5f3a\u5927\u7684 Python \u5e93\uff0c\u4e13\u4e3a\u6570\u636e\u79d1\u5b66\u5bb6\u548c\u673a\u5668\u5b66\u4e60\u5de5\u7a0b\u5e08\u8bbe\u8ba1\uff0c\u7528\u4e8e\u5feb\u901f\u6784\u5efa\u548c\u90e8\u7f72\u6570\u636e\u9a71\u52a8\u7684 Web \u5e94\u7528\u7a0b\u5e8f\u3002Taipy \u63d0\u4f9b\u4e86\u4e00\u6574\u5957\u5de5\u5177\u548c\u7ec4\u4ef6\uff0c\u4f7f\u7528\u6237\u80fd\u591f\u4e13\u6ce8\u4e8e\u6570\u636e\u548c AI \u7b97\u6cd5\uff0c\u800c\u65e0\u9700\u62c5\u5fc3\u5f00\u53d1\u548c\u90e8\u7f72\u7684\u590d\u6742\u6027\u3002\u65e0\u8bba\u662f\u7b80\u5355\u7684\u8bd5\u70b9\u9879\u76ee\u8fd8\u662f\u751f\u4ea7\u7ea7\u5e94\u7528\uff0cTaipy \u90fd\u80fd\u63d0\u4f9b\u9ad8\u6027\u80fd\u3001\u53ef\u5b9a\u5236\u548c\u53ef\u6269\u5c55\u7684\u89e3\u51b3\u65b9\u6848\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter  wp-image-14692\" title=\"Taipy\uff1a\u4e3a\u6570\u636e\u79d1\u5b66\u5bb6\u6253\u9020\u7684\u9ad8\u6548\u6570\u636e\u4e0eAI\u5e94\u7528\u5f00\u6e90Python\u5e93-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/0b43f8d2a31030c.png\" alt=\"Taipy\uff1a\u4e3a\u6570\u636e\u79d1\u5b66\u5bb6\u6253\u9020\u7684\u9ad8\u6548\u6570\u636e\u4e0eAI\u5e94\u7528\u5f00\u6e90Python\u5e93-1\" width=\"1188\" height=\"738\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/0b43f8d2a31030c.png 1361w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/0b43f8d2a31030c-300x186.png 300w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/0b43f8d2a31030c-1024x637.png 1024w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/0b43f8d2a31030c-768x477.png 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/0b43f8d2a31030c-18x12.png 18w\" sizes=\"auto, (max-width: 1188px) 100vw, 1188px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-14693\" title=\"Taipy\uff1a\u4e3a\u6570\u636e\u79d1\u5b66\u5bb6\u6253\u9020\u7684\u9ad8\u6548\u6570\u636e\u5206\u6790\u4e0eAI\u5e94\u7528\u5f00\u6e90Python\u5e93-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/7c905f7aaa75f2a.png\" alt=\"Taipy\uff1a\u4e3a\u6570\u636e\u79d1\u5b66\u5bb6\u6253\u9020\u7684\u9ad8\u6548\u6570\u636e\u5206\u6790\u4e0eAI\u5e94\u7528\u5f00\u6e90Python\u5e93-1\" width=\"1190\" height=\"660\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/7c905f7aaa75f2a.png 1190w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/7c905f7aaa75f2a-300x166.png 300w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/7c905f7aaa75f2a-1024x568.png 1024w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/7c905f7aaa75f2a-768x426.png 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/12\/7c905f7aaa75f2a-18x10.png 18w\" sizes=\"auto, (max-width: 1190px) 100vw, 1190px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li><strong>\u7528\u6237\u754c\u9762\u751f\u6210<\/strong>\uff1a\u901a\u8fc7\u7b80\u5355\u7684 Python \u4ee3\u7801\u751f\u6210\u4ea4\u4e92\u5f0f\u7528\u6237\u754c\u9762\u3002<\/li>\n<li><strong>\u573a\u666f\u4e0e\u6570\u636e\u7ba1\u7406<\/strong>\uff1a\u7ba1\u7406\u590d\u6742\u7684\u6570\u636e\u5904\u7406\u548c\u673a\u5668\u5b66\u4e60\u573a\u666f\u3002<\/li>\n<li><strong>\u5feb\u901f\u542f\u52a8<\/strong>\uff1a\u63d0\u4f9b\u8be6\u7ec6\u7684\u5b89\u88c5\u548c\u5feb\u901f\u542f\u52a8\u6307\u5357\uff0c\u5e2e\u52a9\u7528\u6237\u5feb\u901f\u4e0a\u624b\u3002<\/li>\n<li><strong>\u9ad8\u6027\u80fd<\/strong>\uff1a\u4f18\u5316\u7684\u6027\u80fd\uff0c\u9002\u7528\u4e8e\u5927\u89c4\u6a21\u6570\u636e\u5904\u7406\u548c\u5b9e\u65f6\u5e94\u7528\u3002<\/li>\n<li><strong>\u53ef\u6269\u5c55\u6027<\/strong>\uff1a\u652f\u6301\u81ea\u5b9a\u4e49\u548c\u6269\u5c55\uff0c\u6ee1\u8db3\u4e0d\u540c\u9879\u76ee\u9700\u6c42\u3002<\/li>\n<li><strong>\u793e\u533a\u652f\u6301<\/strong>\uff1a\u6d3b\u8dc3\u7684\u793e\u533a\u548c\u8be6\u7ec6\u7684\u6587\u6863\uff0c\u63d0\u4f9b\u6301\u7eed\u7684\u652f\u6301\u548c\u66f4\u65b0\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h3>\u5b89\u88c5\u6d41\u7a0b<\/h3>\n<ol>\n<li><strong>\u4f7f\u7528 pip \u5b89\u88c5<\/strong>\uff1a\u5728\u7ec8\u7aef\u4e2d\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5b89\u88c5 Taipy\uff1a<\/li>\n<\/ol>\n<pre><code>   pip install taipy\r\n<\/code><\/pre>\n<ol start=\"2\">\n<li><strong>\u914d\u7f6e\u73af\u5883<\/strong>\uff1a\u5efa\u8bae\u4f7f\u7528 Conda \u73af\u5883\u8fdb\u884c\u9694\u79bb\u548c\u7ba1\u7406\uff0c\u786e\u4fdd\u4f9d\u8d56\u5173\u7cfb\u7684\u517c\u5bb9\u6027\u3002<\/li>\n<li><strong>\u5b89\u88c5\u4f9d\u8d56<\/strong>\uff1a\u6839\u636e\u9879\u76ee\u9700\u6c42\uff0c\u5b89\u88c5\u5176\u4ed6\u5fc5\u8981\u7684 Python \u5e93\u3002<\/li>\n<\/ol>\n<h3>\u4f7f\u7528\u6307\u5357<\/h3>\n<h4>\u5feb\u901f\u5f00\u59cb<\/h4>\n<ol>\n<li><strong>\u521b\u5efa\u9879\u76ee<\/strong>\uff1a\u5728\u9879\u76ee\u76ee\u5f55\u4e2d\u521b\u5efa\u4e00\u4e2a\u65b0\u7684 Python \u6587\u4ef6\uff0c\u4f8b\u5982 <code>main.py<\/code>\u3002<\/li>\n<li><strong>\u5bfc\u5165 Taipy<\/strong>\uff1a\u5728\u6587\u4ef6\u4e2d\u5bfc\u5165 Taipy \u5e93\uff1a<\/li>\n<\/ol>\n<pre><code>   import taipy as tp\r\n<\/code><\/pre>\n<ol start=\"3\">\n<li><strong>\u5b9a\u4e49\u573a\u666f<\/strong>\uff1a\u521b\u5efa\u4e00\u4e2a\u7b80\u5355\u7684\u573a\u666f\uff0c\u4f8b\u5982\u7535\u5f71\u63a8\u8350\u7cfb\u7edf\uff1a<\/li>\n<\/ol>\n<pre><code>   import pandas as pd\r\nfrom taipy import Config, Scope, Gui\r\ndef filter_genre(initial_dataset: pd.DataFrame, selected_genre):\r\nfiltered_dataset = initial_dataset[initial_dataset['genres'].str.contains(selected_genre)]\r\nfiltered_data = filtered_dataset.nlargest(7, 'Popularity %')\r\nreturn filtered_data\r\nif __name__ == \"__main__\":\r\nConfig.load(\"config.toml\")\r\nscenario_cfg = Config.scenarios[\"scenario\"]\r\ntp.Orchestrator().run()\r\nscenario = tp.create_scenario(scenario_cfg)\r\ngenres = [\"Action\", \"Adventure\", \"Comedy\", \"Drama\", \"Horror\", \"Sci-Fi\"]\r\ndf = pd.DataFrame(columns=[\"Title\", \"Popularity %\"])\r\nselected_genre = \"Action\"\r\nmy_page = \"\"\"\r\n# Film Recommendation\r\n## Choose Your Favorite Genre\r\n&lt;|{selected_genre}|selector|lov={genres}|on_change=on_genre_selected|dropdown|&gt;\r\n## Here are the Top Seven Picks by Popularity\r\n&lt;|{df}|chart|x=Title|y=Popularity %|type=bar|title=Film Popularity|&gt;\r\n\"\"\"\r\nGui(page=my_page).run()\r\n<\/code><\/pre>\n<h4>\u8be6\u7ec6\u529f\u80fd\u4ecb\u7ecd<\/h4>\n<ul>\n<li><strong>\u7528\u6237\u754c\u9762\u751f\u6210<\/strong>\uff1a\u901a\u8fc7\u7b80\u5355\u7684 Python \u4ee3\u7801\uff0c\u7528\u6237\u53ef\u4ee5\u5feb\u901f\u751f\u6210\u4ea4\u4e92\u5f0f\u7684 Web \u754c\u9762\uff0c\u652f\u6301\u591a\u79cd\u56fe\u8868\u548c\u63a7\u4ef6\u3002<\/li>\n<li><strong>\u573a\u666f\u4e0e\u6570\u636e\u7ba1\u7406<\/strong>\uff1a\u63d0\u4f9b\u5f3a\u5927\u7684\u6570\u636e\u5904\u7406\u548c\u573a\u666f\u7ba1\u7406\u529f\u80fd\uff0c\u652f\u6301\u590d\u6742\u7684\u673a\u5668\u5b66\u4e60\u7ba1\u9053\u548c\u6570\u636e\u6d41\u3002<\/li>\n<li><strong>\u6269\u5c55\u4e0e\u81ea\u5b9a\u4e49<\/strong>\uff1a\u7528\u6237\u53ef\u4ee5\u6839\u636e\u9879\u76ee\u9700\u6c42\uff0c\u81ea\u5b9a\u4e49\u548c\u6269\u5c55 Taipy \u7684\u529f\u80fd\uff0c\u6ee1\u8db3\u7279\u5b9a\u7684\u4e1a\u52a1\u9700\u6c42\u3002<\/li>\n<\/ul>\n<h3>\u5e38\u89c1\u95ee\u9898<\/h3>\n<ul>\n<li><strong>\u5982\u4f55\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\uff1f<\/strong>\uff1aTaipy \u7ecf\u8fc7\u4f18\u5316\uff0c\u80fd\u591f\u9ad8\u6548\u5904\u7406\u5927\u89c4\u6a21\u6570\u636e\uff0c\u5efa\u8bae\u4f7f\u7528\u5206\u5e03\u5f0f\u8ba1\u7b97\u548c\u5e76\u884c\u5904\u7406\u6280\u672f\u3002<\/li>\n<li><strong>\u662f\u5426\u652f\u6301\u591a\u7528\u6237\u534f\u4f5c\uff1f<\/strong>\uff1aTaipy \u652f\u6301\u591a\u7528\u6237\u534f\u4f5c\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6e\u6743\u9650\u548c\u89d2\u8272\uff0c\u5b9e\u73b0\u56e2\u961f\u534f\u4f5c\u3002<\/li>\n<li><strong>\u5982\u4f55\u83b7\u53d6\u6280\u672f\u652f\u6301\uff1f<\/strong>\uff1a\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5b98\u65b9\u6587\u6863\u3001\u793e\u533a\u8bba\u575b\u548c GitHub \u63d0\u4ea4\u95ee\u9898\uff0c\u83b7\u53d6\u6280\u672f\u652f\u6301\u548c\u5e2e\u52a9\u3002<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Taipy \u662f\u7531 Avaiga \u5f00\u53d1\u7684\u4e00\u4e2a\u5f3a\u5927\u7684 Python \u5e93\uff0c\u4e13\u4e3a\u6570\u636e\u79d1\u5b66\u5bb6\u548c\u673a\u5668\u5b66\u4e60\u5de5\u7a0b\u5e08\u8bbe\u8ba1\uff0c\u7528\u4e8e\u5feb\u901f\u6784\u5efa\u548c\u90e8\u7f72\u6570\u636e\u9a71\u52a8\u7684 Web \u5e94\u7528\u7a0b\u5e8f\u3002Taipy \u63d0\u4f9b\u4e86\u4e00\u6574\u5957\u5de5\u5177\u548c\u7ec4\u4ef6\uff0c\u4f7f\u7528\u6237\u80fd\u591f\u4e13\u6ce8\u4e8e\u6570\u636e\u548c AI \u7b97\u6cd5\uff0c\u800c\u65e0\u9700\u62c5\u5fc3\u5f00\u53d1\u548c&#8230;<\/p>\n","protected":false},"author":1,"featured_media":61350,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[230,244],"class_list":["post-14691","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tool","tag-aikaiyuanxiangmu","tag-aishujufenxi"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/14691","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/comments?post=14691"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/posts\/14691\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media\/61350"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/media?parent=14691"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/categories?post=14691"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/de\/wp-json\/wp\/v2\/tags?post=14691"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}