Spaces:
Sleeping
Sleeping
koptelovmax
commited on
Commit
•
e56df02
1
Parent(s):
2916811
Update app
Browse files
app.py
CHANGED
@@ -143,7 +143,7 @@ def main():
|
|
143 |
segmentEn = model.translate(segmentFr , source_lang='fr', target_lang='en')
|
144 |
|
145 |
# Get an AMR graph:
|
146 |
-
stog = amrlib.load_stog_model(model_dir='
|
147 |
inputGraph = stog.parse_sents([segmentEn])
|
148 |
|
149 |
## Output the resulting graph:
|
@@ -181,7 +181,7 @@ def main():
|
|
181 |
#print(targetSubGraph)
|
182 |
|
183 |
# Generate text from given AMR-graph:
|
184 |
-
gtos = amrlib.load_gtos_model(model_dir='
|
185 |
rulesEn, _ = gtos.generate([targetSubGraph])
|
186 |
|
187 |
# Remove "1." from the text:
|
@@ -201,4 +201,4 @@ def main():
|
|
201 |
st.write('Error! Cannot find keyword in the graph')
|
202 |
|
203 |
if __name__ == "__main__":
|
204 |
-
main()
|
|
|
143 |
segmentEn = model.translate(segmentFr , source_lang='fr', target_lang='en')
|
144 |
|
145 |
# Get an AMR graph:
|
146 |
+
stog = amrlib.load_stog_model(model_dir='model_stog')
|
147 |
inputGraph = stog.parse_sents([segmentEn])
|
148 |
|
149 |
## Output the resulting graph:
|
|
|
181 |
#print(targetSubGraph)
|
182 |
|
183 |
# Generate text from given AMR-graph:
|
184 |
+
gtos = amrlib.load_gtos_model(model_dir='model_gtos')
|
185 |
rulesEn, _ = gtos.generate([targetSubGraph])
|
186 |
|
187 |
# Remove "1." from the text:
|
|
|
201 |
st.write('Error! Cannot find keyword in the graph')
|
202 |
|
203 |
if __name__ == "__main__":
|
204 |
+
main()
|