Reem333 commited on
Commit
7558c04
1 Parent(s): 03a7030

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -1
app.py CHANGED
@@ -6,6 +6,13 @@ import os
6
 
7
  model = AutoModelForSequenceClassification.from_pretrained("Reem333/Citaion-Classifier")
8
  tokenizer = AutoTokenizer.from_pretrained("allenai/longformer-base-4096")
 
 
 
 
 
 
 
9
 
10
  def predict_class(text):
11
  try:
@@ -43,7 +50,7 @@ with st.sidebar:
43
  st.markdown("## About")
44
  st.markdown('''
45
  This is a tool to classify paper citations into different levels based on their number of citations.
46
- Powered by Fine-Tuned [Longformer model](https://huggingface.co/REEM-ALRASHIDI/LongFormer-Paper-Citaion-Classifier) with custom data.
47
  ''')
48
  st.markdown("### Class Levels:")
49
  st.markdown("- Level 1: Highly cited papers")
 
6
 
7
  model = AutoModelForSequenceClassification.from_pretrained("Reem333/Citaion-Classifier")
8
  tokenizer = AutoTokenizer.from_pretrained("allenai/longformer-base-4096")
9
+ def extract_text_from_pdf(file_path):
10
+ text = ''
11
+ with fitz.open(file_path) as pdf_document:
12
+ for page_number in range(pdf_document.page_count):
13
+ page = pdf_document.load_page(page_number)
14
+ text += page.get_text()
15
+ return text
16
 
17
  def predict_class(text):
18
  try:
 
50
  st.markdown("## About")
51
  st.markdown('''
52
  This is a tool to classify paper citations into different levels based on their number of citations.
53
+ Powered by Fine-Tuned [Longformer model](https://huggingface.co/Reem333/LongFormer-Paper-Citaion-Classifier) with custom data.
54
  ''')
55
  st.markdown("### Class Levels:")
56
  st.markdown("- Level 1: Highly cited papers")