Spaces:
				
			
			
	
			
			
		Sleeping
		
	
	
	
			
			
	
	
	
	
		
		
		Sleeping
		
	added instructions
Browse files
    	
        app.py
    CHANGED
    
    | @@ -200,17 +200,58 @@ def process_file(model_name,inc_slider,progress=Progress(track_tqdm=True)): | |
| 200 |  | 
| 201 | 
             
                Time Taken: {result['time_taken_from_start']:.2f} seconds\n
         | 
| 202 | 
             
                Total Schools in test: {len(unique_schools):.4f}\n
         | 
| 203 | 
            -
                Total Schools taken: {len(random_schools):.4f}\n
         | 
| 204 | 
             
                Total number of instances having Schools with HGR : {len(high_sample):.4f}\n
         | 
| 205 | 
             
                Total number of instances having Schools with LGR: {len(low_sample):.4f}\n
         | 
| 206 | 
             
                -----------------\n
         | 
| 207 | 
             
                """
         | 
| 208 | 
            -
                return text_output,plot_path | 
| 209 |  | 
| 210 | 
             
            # List of models for the dropdown menu
         | 
| 211 |  | 
| 212 | 
             
            models = ["ASTRA-FT-HGR", "ASTRA-FT-LGR", "ASTRA-FT-FULL"]
         | 
| 213 | 
            -
             | 
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
|  | |
| 214 | 
             
            # Create the Gradio interface
         | 
| 215 | 
             
            with gr.Blocks(css="""
         | 
| 216 | 
             
                body {
         | 
| @@ -218,6 +259,7 @@ with gr.Blocks(css=""" | |
| 218 | 
             
                    font-family: 'Arial', sans-serif;
         | 
| 219 | 
             
                    color: #f5f5f5!important;;
         | 
| 220 | 
             
                }
         | 
|  | |
| 221 | 
             
                .gradio-container {
         | 
| 222 | 
             
                    max-width: 850px!important;
         | 
| 223 | 
             
                    margin: 0 auto!important;;
         | 
| @@ -389,12 +431,15 @@ tbody.svelte-18wv37q>tr.svelte-18wv37q:nth-child(odd) { | |
| 389 | 
             
                color: white;
         | 
| 390 | 
             
                background: #aca7b2;
         | 
| 391 | 
             
            }
         | 
|  | |
| 392 | 
             
            .gradio-container-4-31-4 .prose h1, .gradio-container-4-31-4 .prose h2, .gradio-container-4-31-4 .prose h3, .gradio-container-4-31-4 .prose h4, .gradio-container-4-31-4 .prose h5 {
         | 
| 393 |  | 
| 394 | 
             
                color: white;
         | 
|  | |
| 395 | 
             
            """) as demo:
         | 
| 396 | 
            -
                gr.Markdown("<h1 id='title'>ASTRA</h1>", elem_id="title")
         | 
| 397 |  | 
|  | |
|  | |
| 398 |  | 
| 399 | 
             
                with gr.Row():
         | 
| 400 | 
             
                    # file_input = gr.File(label="Upload a test file", file_types=['.txt'], elem_classes="file-box")
         | 
| @@ -410,11 +455,11 @@ tbody.svelte-18wv37q>tr.svelte-18wv37q:nth-child(odd) { | |
| 410 | 
             
                with gr.Row():
         | 
| 411 | 
             
                    output_text = gr.Textbox(label="")
         | 
| 412 | 
             
                    output_image = gr.Image(label="ROC")
         | 
| 413 | 
            -
                    output_summary = gr.Textbox(label="Summary")
         | 
| 414 |  | 
| 415 | 
             
                btn = gr.Button("Submit")
         | 
| 416 |  | 
| 417 | 
            -
                btn.click(fn=process_file, inputs=[model_dropdown,increment_slider], outputs=[output_text,output_image | 
| 418 |  | 
| 419 |  | 
| 420 | 
             
            # Launch the app
         | 
|  | |
| 200 |  | 
| 201 | 
             
                Time Taken: {result['time_taken_from_start']:.2f} seconds\n
         | 
| 202 | 
             
                Total Schools in test: {len(unique_schools):.4f}\n
         | 
|  | |
| 203 | 
             
                Total number of instances having Schools with HGR : {len(high_sample):.4f}\n
         | 
| 204 | 
             
                Total number of instances having Schools with LGR: {len(low_sample):.4f}\n
         | 
| 205 | 
             
                -----------------\n
         | 
| 206 | 
             
                """
         | 
| 207 | 
            +
                return text_output,plot_path
         | 
| 208 |  | 
| 209 | 
             
            # List of models for the dropdown menu
         | 
| 210 |  | 
| 211 | 
             
            models = ["ASTRA-FT-HGR", "ASTRA-FT-LGR", "ASTRA-FT-FULL"]
         | 
| 212 | 
            +
            content = """
         | 
| 213 | 
            +
            <h1 style="color: white;">ASTRA: An AI Model for Analyzing Math Strategies</h1>
         | 
| 214 | 
            +
             | 
| 215 | 
            +
            <h3 style="color: white;">
         | 
| 216 | 
            +
                <a href="https://drive.google.com/file/d/1lbEpg8Se1ugTtkjreD8eXIg7qrplhWan/view" style="color: #1E90FF; text-decoration: none;">Link To Paper</a> | 
         | 
| 217 | 
            +
                <a href="https://github.com/Syudu41/ASTRA---Gates-Project" style="color: #1E90FF; text-decoration: none;">GitHub</a> | 
         | 
| 218 | 
            +
                <a href="#" style="color: #1E90FF; text-decoration: none;">Project Page</a>
         | 
| 219 | 
            +
            </h3>
         | 
| 220 | 
            +
             | 
| 221 | 
            +
            <p style="color: white;">Welcome to a demo of ASTRA. ASTRA is a collaborative research project between researchers at the 
         | 
| 222 | 
            +
            <a href="https://www.memphis.edu" style="color: #1E90FF; text-decoration: none;">University of Memphis</a> and 
         | 
| 223 | 
            +
            <a href="https://www.carnegielearning.com" style="color: #1E90FF; text-decoration: none;">Carnegie Learning</a> 
         | 
| 224 | 
            +
            to utilize AI to improve our understanding of math learning strategies.</p>
         | 
| 225 | 
            +
             | 
| 226 | 
            +
            <p style="color: white;">This demo has been developed with a pre-trained model (based on an architecture similar to BERT) 
         | 
| 227 | 
            +
            that learns math strategies using data collected from hundreds of schools in the U.S. who have used 
         | 
| 228 | 
            +
            Carnegie Learning's MATHia (formerly known as Cognitive Tutor), the flagship Intelligent Tutor 
         | 
| 229 | 
            +
            that is part of a core, blended math curriculum.</p>
         | 
| 230 | 
            +
             | 
| 231 | 
            +
            <p style="color: white;">For this demo, we have used data from a specific domain (teaching ratio and proportions) within 
         | 
| 232 | 
            +
            7th grade math. The fine-tuning based on the pre-trained models learns to predict which strategies 
         | 
| 233 | 
            +
            lead to correct vs. incorrect solutions.</p>
         | 
| 234 | 
            +
             | 
| 235 | 
            +
            <p style="color: white;">To use the demo, please follow these steps:</p>
         | 
| 236 | 
            +
             | 
| 237 | 
            +
            <ol style="color: white;">
         | 
| 238 | 
            +
                <li style="color: white;">Select a fine-tuned model:
         | 
| 239 | 
            +
                    <ul style="color: white;">
         | 
| 240 | 
            +
                        <li style="color: white;">ASTRA-FT-HGR: Fine-tuned with a small sample of data from schools that have a high graduation rate.</li>
         | 
| 241 | 
            +
                        <li style="color: white;">ASTRA-FT-LGR: Fine-tuned with a small sample of data from schools that have a low graduation rate.</li>
         | 
| 242 | 
            +
                        <li style="color: white;">ASTRA-FT-Full: Fine-tuned with a small sample of data from a mix of schools that have high/low graduation rates.</li>
         | 
| 243 | 
            +
                    </ul>
         | 
| 244 | 
            +
                </li>
         | 
| 245 | 
            +
                <li style="color: white;">Select a percentage of schools to analyze (selecting a large percentage may take a long time).</li>
         | 
| 246 | 
            +
                <li style="color: white;">View Results:
         | 
| 247 | 
            +
                    <ul>
         | 
| 248 | 
            +
                        <li style="color: white;">The results from the fine-tuned model are displayed on the dashboard.</li>
         | 
| 249 | 
            +
                        <li style="color: white;">The results are shown separately for schools that have high and low graduation rates.</li>
         | 
| 250 | 
            +
                    </ul>
         | 
| 251 | 
            +
                </li>
         | 
| 252 | 
            +
            </ol>
         | 
| 253 | 
            +
            """
         | 
| 254 | 
            +
            # CSS styling for white text
         | 
| 255 | 
             
            # Create the Gradio interface
         | 
| 256 | 
             
            with gr.Blocks(css="""
         | 
| 257 | 
             
                body {
         | 
|  | |
| 259 | 
             
                    font-family: 'Arial', sans-serif;
         | 
| 260 | 
             
                    color: #f5f5f5!important;;
         | 
| 261 | 
             
                }
         | 
| 262 | 
            +
             | 
| 263 | 
             
                .gradio-container {
         | 
| 264 | 
             
                    max-width: 850px!important;
         | 
| 265 | 
             
                    margin: 0 auto!important;;
         | 
|  | |
| 431 | 
             
                color: white;
         | 
| 432 | 
             
                background: #aca7b2;
         | 
| 433 | 
             
            }
         | 
| 434 | 
            +
             | 
| 435 | 
             
            .gradio-container-4-31-4 .prose h1, .gradio-container-4-31-4 .prose h2, .gradio-container-4-31-4 .prose h3, .gradio-container-4-31-4 .prose h4, .gradio-container-4-31-4 .prose h5 {
         | 
| 436 |  | 
| 437 | 
             
                color: white;
         | 
| 438 | 
            +
            }
         | 
| 439 | 
             
            """) as demo:
         | 
|  | |
| 440 |  | 
| 441 | 
            +
                gr.Markdown("<h1 id='title'>ASTRA</h1>", elem_id="title")
         | 
| 442 | 
            +
                gr.Markdown(content)
         | 
| 443 |  | 
| 444 | 
             
                with gr.Row():
         | 
| 445 | 
             
                    # file_input = gr.File(label="Upload a test file", file_types=['.txt'], elem_classes="file-box")
         | 
|  | |
| 455 | 
             
                with gr.Row():
         | 
| 456 | 
             
                    output_text = gr.Textbox(label="")
         | 
| 457 | 
             
                    output_image = gr.Image(label="ROC")
         | 
| 458 | 
            +
                    # output_summary = gr.Textbox(label="Summary")
         | 
| 459 |  | 
| 460 | 
             
                btn = gr.Button("Submit")
         | 
| 461 |  | 
| 462 | 
            +
                btn.click(fn=process_file, inputs=[model_dropdown,increment_slider], outputs=[output_text,output_image])
         | 
| 463 |  | 
| 464 |  | 
| 465 | 
             
            # Launch the app
         | 
    	
        ratio_proportion_change3_2223/sch_largest_100-coded/finetuning/lowGRschoolAll/test_label.txt
    CHANGED
    
    | The diff for this file is too large to render. 
		See raw diff | 
|  | 
    	
        result.txt
    CHANGED
    
    | @@ -3,5 +3,5 @@ total_acc: 69.02834008097166 | |
| 3 | 
             
            precisions: 0.7233000757179396
         | 
| 4 | 
             
            recalls: 0.6902834008097166
         | 
| 5 | 
             
            f1_scores: 0.680564448931978
         | 
| 6 | 
            -
            time_taken_from_start:  | 
| 7 | 
             
            auc_score: 0.7527458335895701
         | 
|  | |
| 3 | 
             
            precisions: 0.7233000757179396
         | 
| 4 | 
             
            recalls: 0.6902834008097166
         | 
| 5 | 
             
            f1_scores: 0.680564448931978
         | 
| 6 | 
            +
            time_taken_from_start: 33.72925329208374
         | 
| 7 | 
             
            auc_score: 0.7527458335895701
         |