Spaces:
Sleeping
Sleeping
Rename app.py to streamlit_app.py
Browse files- app.py → streamlit_app.py +55 -2
app.py → streamlit_app.py
RENAMED
|
@@ -27,8 +27,61 @@ def load_rewriter(model_name):
|
|
| 27 |
return pipeline("text2text-generation", model=model, tokenizer=tokenizer, device=0 if torch.cuda.is_available() else -1)
|
| 28 |
|
| 29 |
HEADERS = [
|
| 30 |
-
|
| 31 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 32 |
]
|
| 33 |
header_pattern = re.compile(rf"\n*(?:\d{{0,2}}[\.\)]?\s*)?({'|'.join(HEADERS)})\s*\n", re.IGNORECASE)
|
| 34 |
|
|
|
|
| 27 |
return pipeline("text2text-generation", model=model, tokenizer=tokenizer, device=0 if torch.cuda.is_available() else -1)
|
| 28 |
|
| 29 |
HEADERS = [
|
| 30 |
+
# Standard sections
|
| 31 |
+
"Abstract", "Introduction", "Background",
|
| 32 |
+
"Related Work", "Literature Review", "Theoretical Framework",
|
| 33 |
+
"Methodology", "Research Methodology", "Materials and Methods",
|
| 34 |
+
"Experimental Setup", "Experimental Design", "Research Design",
|
| 35 |
+
"Implementation", "System Architecture", "Algorithm",
|
| 36 |
+
"Data Collection", "Data Analysis", "Statistical Analysis",
|
| 37 |
+
"Results", "Findings", "Experimental Results", "Case Study",
|
| 38 |
+
"Discussion", "Analysis", "Interpretation", "Evaluation",
|
| 39 |
+
"Conclusion", "Conclusions", "Summary", "Future Work",
|
| 40 |
+
"Recommendations", "Implications", "Limitations",
|
| 41 |
+
"References", "Bibliography", "Acknowledgements",
|
| 42 |
+
|
| 43 |
+
# Subject-specific sections
|
| 44 |
+
# STEM
|
| 45 |
+
"Hypothesis", "Procedure", "Observations",
|
| 46 |
+
"Calculations", "Derivation", "Proof",
|
| 47 |
+
"Simulation", "Modeling", "Validation",
|
| 48 |
+
"Performance Metrics", "Benchmarking",
|
| 49 |
+
|
| 50 |
+
# Medical/Health Sciences
|
| 51 |
+
"Clinical Trial", "Patient Characteristics",
|
| 52 |
+
"Intervention", "Outcome Measures",
|
| 53 |
+
"Adverse Effects", "Ethical Considerations",
|
| 54 |
+
|
| 55 |
+
# Social Sciences
|
| 56 |
+
"Research Questions", "Conceptual Framework",
|
| 57 |
+
"Participant Demographics", "Survey Instrument",
|
| 58 |
+
"Qualitative Analysis", "Quantitative Analysis",
|
| 59 |
+
"Themes", "Coding Scheme",
|
| 60 |
+
|
| 61 |
+
# Business/Economics
|
| 62 |
+
"Market Analysis", "Financial Projections",
|
| 63 |
+
"SWOT Analysis", "Case Analysis",
|
| 64 |
+
"Return on Investment", "Cost-Benefit Analysis",
|
| 65 |
+
|
| 66 |
+
# Humanities
|
| 67 |
+
"Historical Context", "Textual Analysis",
|
| 68 |
+
"Critical Review", "Comparative Analysis",
|
| 69 |
+
"Theoretical Perspective",
|
| 70 |
+
|
| 71 |
+
# Engineering/CS
|
| 72 |
+
"System Requirements", "Technical Specifications",
|
| 73 |
+
"Pseudocode", "Flowchart", "UML Diagram",
|
| 74 |
+
"User Interface", "API Documentation",
|
| 75 |
+
"Error Analysis", "Optimization",
|
| 76 |
+
|
| 77 |
+
# Appendices
|
| 78 |
+
"Appendix A", "Appendix B", "Supplementary Materials",
|
| 79 |
+
"Additional Results", "Raw Data",
|
| 80 |
+
|
| 81 |
+
# Conference/Journal Specific
|
| 82 |
+
"Key Takeaways", "Author Contributions",
|
| 83 |
+
"Conflict of Interest", "Data Availability",
|
| 84 |
+
"Supplementary Information"
|
| 85 |
]
|
| 86 |
header_pattern = re.compile(rf"\n*(?:\d{{0,2}}[\.\)]?\s*)?({'|'.join(HEADERS)})\s*\n", re.IGNORECASE)
|
| 87 |
|