Ankush05 commited on
Commit
1f8ec05
·
1 Parent(s): 1ecff25
Files changed (2) hide show
  1. app.py +15 -7
  2. requirements.txt +1 -2
app.py CHANGED
@@ -1,12 +1,20 @@
1
  import streamlit as st
2
  import os
3
- from pymongo import MongoClient
 
4
 
5
- uri = os.environ["MONGO_CONNECTION_STRING"]
6
- client = MongoClient(uri, tlsCertificateKeyFile = "database/cert.pem")
7
- db = client["testing"]
8
- col = db["new"]
9
 
10
- xyz = {"This is new code678"}
11
- col.insert_one(xyz)
 
 
12
 
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
  import os
3
+ from transformers import pipeline
4
+ # from pymongo import MongoClient
5
 
 
 
 
 
6
 
7
+ # uri = os.environ["MONGO_CONNECTION_STRING"]
8
+ # client = MongoClient(uri, tlsCertificateKeyFile = "database/cert.pem")
9
+ # db = client["testing"]
10
+ # col = db["new"]
11
 
12
+ # xyz = {"This is new code678"}
13
+ # col.insert_one(xyz)
14
+
15
+ token_classifier = pipeline(model="Jean-Baptiste/camembert-ner", aggregation_strategy="simple")
16
+ if ner := st.chat_input("query "):
17
+ ans = token_classifier(ner)
18
+ with st.chat_message("User"):
19
+ st.write(ans)
20
+
requirements.txt CHANGED
@@ -1,3 +1,2 @@
1
  streamlit
2
- pymongo
3
- dnspython
 
1
  streamlit
2
+ transformers[torch]