Upload 2 files
Browse filesFiles changed (2)
- Diemthi2024_processed.csv+2-2
- app.py+12-12
123version https://git-lfs.github.com/spec/v1oid sha256:bbccd2afd0eaed4a95cd6450670ea95956dd796807b009a43cdce25ba35befe7size 85314820123version https://git-lfs.github.com/spec/v1oid sha256:1945694c4016fa6b2b283d1f2016eb1bd4acafe1de4b224351f8c76746958665size 199489384
6 unmodified lines7891011121314151617181920212219 unmodified lines424344454647484950515253545556575859606162636 unmodified linesdef respond(sbd, khoi):khoi = khoi.lower()score = df[df['sbd'] == int(sbd)]count_all = (df[khoi] >= score[khoi].iloc[0]).sum()count_kv = ((df[khoi] >= score[khoi].iloc[0]) & (df['kv'] == score['kv'].iloc[0])).sum()count_tinh = ((df[khoi] >= score[khoi].iloc[0]) & (df['tinh'] == score['tinh'].iloc[0])).sum()return f"""Your score is {score[khoi].iloc[0]}National Ranking: {count_all}Regional Ranking: {count_kv}Provincal Ranking: {count_tinh}""""""Chatbot19 unmodified linesfont-size: 16px;}</style><span style='font-family: Arial, sans-serif; font-size: 20px;'>National Graduation Exam Score Ranking</span><p style='font-family: Arial, sans-serif;'>Input your ID and your combination:</p>""")with gr.Row():id = gr.Textbox(placeholder="Input your ID", label="Input your ID:", lines=1)comb = gr.Dropdown(["A00", "A01", "B00", "C00", "C03", "D01", "D07"], label="Select your Combination:", info="Will add more combinations later!")with gr.Row():check_button = gr.Button("Rank now!", variant="primary")out = gr.Textbox(label="OUTPUT", placeholder="", lines=2)check_button.click(fn=respond, inputs=[id,comb], outputs=out)if __name__ == "__main__":demo.launch()6 unmodified lines78910111213141516171819202119 unmodified lines41424344454647484950515253545556575859606162636 unmodified linesdef respond(sbd, khoi):score = df[df['sbd'] == int(sbd)]count_all = (df[khoi] >= score[khoi].iloc[0]).sum()count_kv = ((df[khoi] >= score[khoi].iloc[0]) & (df['kv'] == score['kv'].iloc[0])).sum()count_tinh = ((df[khoi] >= score[khoi].iloc[0]) & (df['tinh'] == score['tinh'].iloc[0])).sum()return f"""Tổng điểm theo khối {khoi} của bạn là: {score[khoi].iloc[0]}Thứ hạng toàn quốc: {count_all}Thứ hạng theo khu vực: {count_kv}Thứ hạng theo tỉnh: {count_tinh}""", score.iloc[:, 1:10]"""Chatbot19 unmodified linesfont-size: 16px;}</style><span style='font-family: Arial, sans-serif; font-size: 20px;'>Xếp hạng điểm thi Tốt nghiệp THPT 2024</span><p style='font-family: Arial, sans-serif;'>Nhập số báo danh và lựa chọn tổ hợp của bạn bên dưới</p>""")with gr.Row():id = gr.Textbox(placeholder="Nhập SBD của bạn", label="Nhập SBD của bạn:", lines=1)comb = gr.Dropdown(["A00","A01","A02","A03","A04","A05","A06","A07","A08","A09","A10","A11","A12","A14","A15","A16","A17","A18","B00","B01","B02","B03","B04","B05","B08","C00","C01","C02","C03","C04","C05","C06","C07","C08","C09","C10","C12","C13","C14","C15","C16","C17","C18","C19","C20","D01","D07","D08","D09","D10","D11","D12","D13","D14","D15","D66","D72","D78","D84","D90","D96"], label="Chọn tổ hợp của bạn:", info="Đang cập nhật thêm các tổ hợp...")with gr.Row():check_button = gr.Button("Tra cứu!", variant="primary")dfShow = gr.DataFrame(label="Điểm thi", col_count=(9, "fixed"), row_count=(1, "fixed"))out = gr.Textbox(label="Xếp hạng", placeholder="", lines=2)check_button.click(fn=respond, inputs=[id,comb], outputs=[out,dfShow])if __name__ == "__main__":demo.launch()
Diemthi2024_processed.csv+2-2
app.py+12-12