Sina1138 commited on
Commit
e26a8a6
·
1 Parent(s): 8cd3e46

Remove old README content and add deployment script for Hugging Face Spaces

Browse files
Files changed (3) hide show
  1. README.md +0 -13
  2. deploy_hf.sh +43 -0
  3. readme.md +0 -100
README.md CHANGED
@@ -1,16 +1,3 @@
1
- <!---
2
- title: ReView
3
- emoji: 📚
4
- colorFrom: green
5
- colorTo: blue
6
- sdk: gradio
7
- sdk_version: 6.9.0
8
- app_file: interface/Demo.py
9
- pinned: true
10
- license: mit
11
- short_description: Visualize and analyze scientific peer reviews
12
- --->
13
-
14
  This is the repository of ReView: A Tool for Visualizing and Analyzing Scientific Reviews. [Code](https://github.com/sina1138/glimpse-ui) | [Hugging Face Spaces](https://huggingface.co/spaces/Sina1138/ReView)
15
  <!-- [Paper]() | -->
16
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  This is the repository of ReView: A Tool for Visualizing and Analyzing Scientific Reviews. [Code](https://github.com/sina1138/glimpse-ui) | [Hugging Face Spaces](https://huggingface.co/spaces/Sina1138/ReView)
2
  <!-- [Paper]() | -->
3
 
deploy_hf.sh ADDED
@@ -0,0 +1,43 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # Deploy to HuggingFace Spaces
5
+ # Adds YAML frontmatter to README.md on a temporary branch, pushes, then cleans up.
6
+
7
+ # Ensure clean working tree
8
+ if ! git diff --quiet || ! git diff --cached --quiet; then
9
+ echo "Error: Working tree not clean. Commit or stash your changes first."
10
+ exit 1
11
+ fi
12
+
13
+ CURRENT_BRANCH=$(git rev-parse --abbrev-ref HEAD)
14
+
15
+ # Create temporary deploy branch
16
+ git checkout -b _hf_deploy
17
+
18
+ # Replace README.md with HF Spaces metadata
19
+ cat > README.md << 'EOF'
20
+ ---
21
+ title: ReView
22
+ emoji: 📚
23
+ colorFrom: green
24
+ colorTo: blue
25
+ sdk: gradio
26
+ sdk_version: 6.9.0
27
+ app_file: interface/Demo.py
28
+ pinned: true
29
+ license: mit
30
+ short_description: Visualize and analyze scientific peer reviews
31
+ ---
32
+ EOF
33
+
34
+ # Commit and push
35
+ git add README.md
36
+ git commit -m "Add HF Spaces metadata for deployment"
37
+ git push space _hf_deploy:main --force
38
+
39
+ # Clean up
40
+ git checkout "$CURRENT_BRANCH"
41
+ git branch -D _hf_deploy
42
+
43
+ echo "Deployed to HF Spaces successfully!"
readme.md DELETED
@@ -1,100 +0,0 @@
1
- This is the repository of ReView: A Tool for Visualizing and Analyzing Scientific Reviews. [Code](https://github.com/sina1138/glimpse-ui) | [Hugging Face Spaces](https://huggingface.co/spaces/Sina1138/ReView)
2
- <!-- [Paper]() | -->
3
-
4
- <!-- ## Cloning this repository
5
-
6
- This project uses Git submodules. To clone including all submodules, run:
7
- ```bash
8
- git clone --recurse-submodules https://github.com/Sina1138/glimpse-ui.git
9
- ```
10
- If you already cloned without submodules, run:
11
- ```git submodule update --init --recursive``` -->
12
-
13
- ## Installation
14
-
15
- - Since this project was built with Python 3.10, first create the following virtual environment:
16
- ``` bash
17
- module load miniconda/3
18
- conda create -n ReView python=3.10
19
- ```
20
- - Second, activate the environment and install pytorch:
21
- ``` bash
22
- conda activate ReView
23
- ```
24
-
25
- - In the next step, make sure you have git-lfs package and install git lfs, since it is used in this repo for the preprocessed dataset:
26
- ``` bash
27
- conda install git-lfs
28
- git lfs install
29
- ```
30
-
31
- - Finally, all remaining required packages could be installed with the requirements file:
32
-
33
- ``` bash
34
- pip install -r requirements.txt
35
- ```
36
-
37
- - (Optional) To enable fetching reviews directly from OpenReview links in the Interactive tab:
38
- ``` bash
39
- pip install openreview-py
40
- ```
41
-
42
- ## Running Interface Locally
43
-
44
- To run this interface locally, first, make sure `gradio` and all the requirements are installed in your environment. Then, you can run the following for a local instance of the interface:
45
- ```bash
46
- python interface/Demo.py
47
- ```
48
-
49
- > **Note:** Do not use `gradio ./interface/Demo.py` (hot-reload mode), as it is currenlty incompatible with the interface's dynamic UI.
50
-
51
- Additionally, you can edit the last line of code for a shareable link of your local instance as desired (change `demo.launch(share=False)` to `demo.launch(share=True)`)
52
-
53
- ## Introduction and Instructions
54
-
55
- For an up-to-date, concise, and brief introduction of the interface, you can check out the "Introduction" tab of the ReView app [here](https://huggingface.co/spaces/Sina1138/ReView)
56
-
57
- ## Data Processing Pipeline
58
-
59
- All data processing scripts live in the `pipeline/` directory:
60
-
61
- | File | Purpose |
62
- |------|---------|
63
- | `pipeline/run_scoring.py` | Unified end-to-end pipeline orchestrator |
64
- | `pipeline/process_new_data.sh` | Shell entry point (forwards to `run_scoring.py`) |
65
- | `pipeline/fetch_iclr_data.py` | Fetch reviews from OpenReview API |
66
- | `pipeline/preprocess_data.py` | Text cleaning and preprocessing |
67
- | `pipeline/run_glimpse_scoring.py` | GLIMPSE consensuality/agreement scoring |
68
- | `pipeline/run_polarity_scoring.py` | Polarity/sentiment scoring |
69
- | `pipeline/run_topic_scoring.py` | Topic/aspect scoring |
70
- | `pipeline/scored_reviews_builder.py` | Integrate all scores into final dataset |
71
- | `pipeline/config.py` | Centralized configuration |
72
-
73
- The pipeline auto-detects available years from the `data/` directory. To process data for any year:
74
-
75
- ```bash
76
- # Fetch data for a new year
77
- python pipeline/fetch_iclr_data.py --year 2026
78
-
79
- # Run the full scoring pipeline (auto-detects all available years)
80
- ./pipeline/process_new_data.sh
81
-
82
- # Or run for a specific year
83
- ./pipeline/process_new_data.sh --year 2026
84
- ```
85
-
86
- ## Performance
87
-
88
- Since this project was built for deployment on Hugging Face Spaces, it is optimized to run on CPU. However, if better performance is needed, you can run this interface on a CUDA-enabled device and profit from the improved performance of the models in the interactive page. The code is set up to automatically use CUDA if available.
89
-
90
-
91
- # Information for Hugging Face Spaces
92
- ---
93
- title: ReView
94
- emoji: 📝
95
- colorFrom: blue
96
- colorTo: green
97
- sdk: gradio
98
- app_file: interface/Demo.py
99
- pinned: true
100
- ---